在Heroku上使用PointDNS来管理SSL和非www到www重定向 [英] Using PointDNS on Heroku to manage SSL and non-www to www redirects
问题描述
我一直在使用Heroku托管和管理需要SSL证书的我的网站.在过去的一年半中,我一直在使用ZerigoDNS来管理我的域和SSL重定向(尽管从非https,非www重定向到https和www无效).
I've been using Heroku to host and manage a website of mine that requires an SSL certificate. For the last year and a half I've been using ZerigoDNS to manage my domain and SSL redirecting (although, redirecting from non-https, non-www to https and www does not work).
我刚刚收到Heroku的通知,他们将很快关闭ZerigoDNS,他们建议切换到PointDNS.我在PointDNS文档中找不到有关管理SSL重定向的任何信息.
I just got a notice from Heroku that they will be shutting down ZerigoDNS soon and they recommend switching to PointDNS. I couldn't find any information in the PointDNS documentation about managing SSL redirects.
这就是我想要做的:
-
非www非https重定向到https和www
non-www non-https redirects to https and www
非https重定向到https和www
non-https redirects to https and www
https,但非www重定向到https和www
https but non-www redirects to https and www
所有内容都必须转发到https和www的原因是创建ssl证书的原因(需要www.我没有通配符证书).
The reason everything needs to be forwarded to https and www is that's what the ssl cert was created for (the www is required. I don't have a wildcard certificate).
熟悉PointDNS的人知道如何设置记录并正确重定向吗?
Does anyone familiar with PointDNS know how to to set up the records and redirects properly?
提前谢谢!
推荐答案
首先,同时添加两个 www.your-domain .com 和your-domain.com作为设置下的自定义域或在命令下运行
First, add both www.your-domain.com and your-domain.com as custom domains under settings or run below commands
heroku domains:add domainname.com
heroku domains:add www.domainname.com
对于重定向,您需要通过服务器来完成,例如.如果您使用的是Apache,则可以通过.htacess文件来实现重定向.
For redirection, you need to do it via server, eg. if you are using apache you can achieve redirections via .htacess file.
此外,您只能使用pointDNS重定向选项将非www重定向到www
Also, you can only redirect non-www to www with pointDNS redirect option
这篇关于在Heroku上使用PointDNS来管理SSL和非www到www重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!