heroku - heroku非www重定向到www域的网络解决方案

标签 heroku dns subdomain http-redirect no-www

这是我关于将网络解决方案上的域重定向到 Heroku 上托管的 Web 应用程序的一个非常具体的问题。我已经设置好,在 CNAME 记录中,Allias www 指的是 heroku 中的主机名。问题是,目前如果我输入不带 www 的网址,它不会呈现我的页面。有人可以帮我吗?我已经非常努力地想弄清楚这一点。希望这篇文章将来也能对其他人有所帮助。

CNAME Redirection screenshot. does not work without www alias

最佳答案

将 yourdomain.com 指向 www.yourdomain.com 的网络解决方案。方法如下。

在客户管理器中,选择“我的域名”

Select the domain name that you want to manage

在绿色框中,选择“更改域点位置”

Select Advanced DNS, then Continue

首先,通过选择“编辑 A 记录”来编辑 A 记录

For the "@ none" enter the following IP address 205.178.189.129, 
clear (delete) the records for the "www" and "* (All others)", 
then select Continue.
Sometimes this takes a few moments for the first step to take effect.

其次,选择“编辑 CNAME 记录”来编辑主机别名(CNAME 记录)

Enter "www" in the Alias column

Leave TTL set to 7200 but on the same line, enter the name servers provided by the blogging service in the Other Host section [ IE FOLLOW THE HEROKU INSTRUCTIONS NOW www --> yourapp.herokuapp.com (Cedar Stack) ]

选择继续

现在等待并使用以下终端命令检查域:

主机域名.com 主机 www.domain.com

关于heroku - heroku非www重定向到www域的网络解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16182098/

相关文章:

php - POST 请求在 Heroku 上作为 GET 请求被接收

ruby-on-rails - 将新代码部署到 Heroku 时如何强制 ActionCable 断开所有客户端的连接

java - Heroku 无法检测到构建包 - Spring Boot

linux - Docker 容器可以访问 DNS 但不能解析主机

ruby-on-rails - 横向扩展 : how to handle communication between Ruby on Rails applications?

python - 澄清 : Does Heroku Run Python Apps Behind Nginx or Not?

ubuntu - dnsmasq 仅在本地机器上工作

c++ - 如何获取有关域 .NET C++ 的信息

asp.net - Web 应用程序中图像、视频和其他 Assets 的子域

ruby-on-rails - 将 PointDNS 用于非 www 并处理 SSL