Redirecting naked domain to www with DNSimple

拜拜、爱过 提交于 2019-12-20 14:16:04

问题


We're using DNS simple to point our domain to our SSL-enabled Heroku app. The behavior we're seeking is as follows:

http://ourdomain.com
https://ourdomain.com
http://www.ourdomain.com

Should all permanently redirect to:

https://www.ourdomain.com

We've already created a CNAME for www.ourdomain.com that points to our app's .herokussl.com domain, but we're not sure what to do with the naked domains. In GoDaddy, we used to do non-masked forwarding. DNSimple doesn't have forwarding, but does have special entries called ALIAS and URL, though we're not sure what to use.


回答1:


To configure a redirect you should use an URL record as described in our redirect documentation.

However, it's not possible to redirect an HTTPS URL because of the priority between SSL negotiation and HTTP headers. In this case, because you also want https://ourdomain.com to redirect to https://www.ourdomain.com, then you need to create an ALIAS for ourdomain.com to your Heroku SSL endpoint and handle the redirect in your app.



来源:https://stackoverflow.com/questions/19525344/redirecting-naked-domain-to-www-with-dnsimple

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!