在Heroku上重定向旧的SSL域名(w / Rails 3) [英] Redirecting an old SSL domain to a new one on Heroku (w/ Rails 3)

查看:145
本文介绍了在Heroku上重定向旧的SSL域名(w / Rails 3)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去一小时,我一直在Google上搜索,但无法完全明白。也许你们可以在这里协助!

以下是我想要做的:



旧网站是:

old.tld

新网站是:

new.tld



一群人通过SSL访问旧网站上的特定传统网址,即:



https://www.old.tld/old_url



我在Heroku上设置了一个全新的站点,在新域名上运行Rails 3。



我也安装了Heroku的SSL端点添加-on并使用新的安全子域名:



secure.new.tld



我有一个一堆重定向&约束在我的Rails routes.rb重定向旧 - >新并传递适当的请求。一切工作完美的非SSL的东西。



我似乎无法正常工作的唯一的事情是重定向



https://www.old.tld/old_url - > https://secure.new.tld/new_url



Safari似乎并不介意,但Chrome浏览器正在抛出一个这可能不是你正在寻找的网站!错误。它说(只有在通过SSL尝试时):



您试图访问www.old.tld,但实际上您已到达一个将自己标识为secure.new的服务器。 tld等等。
$ b

(这正是我想要的,但Chrome似乎不赞同;)

关于如何正确配置的任何想法?

解决方案

无缝的解决方案是获得SAN(主题备用名称)证书这两个安全请求之间插入一个不安全的请求:从 https://www.old.tld - > http://secure.new.tld - > https://secure.new.tld 。我没有真正测试过,但它理论上应该起作用。如果它不正常工作,那么您可以尝试在 http://secure.new.tld ,并附有 https://secure.new.tld 的连结。

I've been googling for the past hour on this but can't quite get it nailed down. Perhaps you guys can assist here!

Here's what I'm trying to do:

Old site is:

old.tld

New site is:

new.tld

A bunch of folks access one particular legacy url on the old site via SSL, i.e.:

https://www.old.tld/old_url

I've just setup a brand new site on Heroku, running Rails 3, on the new domain.

I also have installed Heroku's SSL Endpoint Add-on and am using a new secure subdomain:

secure.new.tld

I've got a bunch of redirects & constraints in my Rails routes.rb to redirect old -> new and pass the appropriate requests. Everything works perfectly for the non-SSL stuff.

The only thing I can't seem to get working properly is the redirects of

https://www.old.tld/old_url -> https://secure.new.tld/new_url

Safari doesn't seem to mind, but Chrome is throwing a "This is probably not the site you are looking for!" error. It says (only when trying via SSL):

"You attempted to reach www.old.tld, but instead you actually reached a server identifying itself as secure.new.tld" Etc.

(which is exactly what I want, but Chrome doesn't seem to approve ;)

Any thoughts on how to properly configure?

解决方案

The seamless solution it is to get a SAN (Subject Alternative Name) certificate that has both the old name and the new name.

Another way is to insert a non-secure request in between the two secure requests: redirect from https://www.old.tld -> http://secure.new.tld -> https://secure.new.tld. I haven't actually tested this, but it should work in theory. If it doesn't "just work", then you might try adding an actual page at http://secure.new.tld with a message and a link to https://secure.new.tld.

这篇关于在Heroku上重定向旧的SSL域名(w / Rails 3)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆