自定义域上的页面出现 "too many redirects" 错误
Page on custom domain gives "too many redirects" error
我有一个来自 Namecheap.com 的域,并通过 github 个页面托管了一个页面。有时我的页面无法加载并给出 "too many redirects" 错误。我认为问题出在我的高级 DNS 中的某个地方。看看吧-enter image description here
基本上我有 2 个 A 记录指向 Github 的 IP 地址和一个 CNAME 记录指向 mygithubusername.github.io 和一个 URL 重定向记录指向我的域。我做错了什么?
据我所知,问题来自 URL 重定向记录。当试图到达 www.akshayud.me
时,它重定向到 akshayud.me
,当它到达 URL 重定向时,它重定向回 www.akshayud.me
,它重定向到 akshayud.me
并正在制作一个无限循环。
要解决此问题,请从 DNS 中删除 URL 记录(这是我的首选解决方案)或修复从 www 到 web 服务器级别根目录的重定向。
这是我的 wget 输出(我只使用 URL 记录 IP 来保证 100% 使用 URL 重定向记录):
$ wget www.akshayud.me
--2017-12-19 08:03:18-- http://www.akshayud.me/
Resolving www.akshayud.me (www.akshayud.me)... 151.101.1.147, 151.101.65.147, 151.101.129.147, ...
Connecting to www.akshayud.me (www.akshayud.me)|151.101.1.147|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://akshayud.me/ [following]
--2017-12-19 08:03:18-- http://akshayud.me/
Resolving akshayud.me (akshayud.me)... 162.255.119.148
Connecting to akshayud.me (akshayud.me)|162.255.119.148|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.akshayud.me/ [following]
--2017-12-19 08:03:18-- http://www.akshayud.me/
Connecting to www.akshayud.me (www.akshayud.me)|151.101.1.147|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://akshayud.me/ [following]
--2017-12-19 08:03:18-- http://akshayud.me/
Connecting to akshayud.me (akshayud.me)|162.255.119.148|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.akshayud.me/ [following]
--2017-12-19 08:03:19-- http://www.akshayud.me/
Connecting to www.akshayud.me (www.akshayud.me)|151.101.1.147|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://akshayud.me/ [following]
我遇到了同样的问题,我的解决方案是在我的 github CNAME 文件中,我不得不更改我的网页标题。所以在我把它改成 "www.mywebpage.hu" 之后(在没有 "www." 之前),就没有再发生重定向问题了。我检查了你的 CNAME,你也没有 'www.',如果你用这个来完成你的标题,也许它会有所帮助。
我遇到了同样的麻烦,就我而言,
我是如何修复的:
错误在我的 CNAME 记录中。我将 CNAME www
指向我的 github 页面域 (username.github.io),因此当我访问该域时,它会创建一个 github domain -> custom domain -> github domain .....
循环作为 github 域自动重定向到自定义域。将 CNAME 值更改为我的自定义域解决了问题
我有一个来自 Namecheap.com 的域,并通过 github 个页面托管了一个页面。有时我的页面无法加载并给出 "too many redirects" 错误。我认为问题出在我的高级 DNS 中的某个地方。看看吧-enter image description here
基本上我有 2 个 A 记录指向 Github 的 IP 地址和一个 CNAME 记录指向 mygithubusername.github.io 和一个 URL 重定向记录指向我的域。我做错了什么?
据我所知,问题来自 URL 重定向记录。当试图到达 www.akshayud.me
时,它重定向到 akshayud.me
,当它到达 URL 重定向时,它重定向回 www.akshayud.me
,它重定向到 akshayud.me
并正在制作一个无限循环。
要解决此问题,请从 DNS 中删除 URL 记录(这是我的首选解决方案)或修复从 www 到 web 服务器级别根目录的重定向。 这是我的 wget 输出(我只使用 URL 记录 IP 来保证 100% 使用 URL 重定向记录):
$ wget www.akshayud.me
--2017-12-19 08:03:18-- http://www.akshayud.me/
Resolving www.akshayud.me (www.akshayud.me)... 151.101.1.147, 151.101.65.147, 151.101.129.147, ...
Connecting to www.akshayud.me (www.akshayud.me)|151.101.1.147|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://akshayud.me/ [following]
--2017-12-19 08:03:18-- http://akshayud.me/
Resolving akshayud.me (akshayud.me)... 162.255.119.148
Connecting to akshayud.me (akshayud.me)|162.255.119.148|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.akshayud.me/ [following]
--2017-12-19 08:03:18-- http://www.akshayud.me/
Connecting to www.akshayud.me (www.akshayud.me)|151.101.1.147|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://akshayud.me/ [following]
--2017-12-19 08:03:18-- http://akshayud.me/
Connecting to akshayud.me (akshayud.me)|162.255.119.148|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.akshayud.me/ [following]
--2017-12-19 08:03:19-- http://www.akshayud.me/
Connecting to www.akshayud.me (www.akshayud.me)|151.101.1.147|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://akshayud.me/ [following]
我遇到了同样的问题,我的解决方案是在我的 github CNAME 文件中,我不得不更改我的网页标题。所以在我把它改成 "www.mywebpage.hu" 之后(在没有 "www." 之前),就没有再发生重定向问题了。我检查了你的 CNAME,你也没有 'www.',如果你用这个来完成你的标题,也许它会有所帮助。
我遇到了同样的麻烦,就我而言,
我是如何修复的:
错误在我的 CNAME 记录中。我将 CNAME www
指向我的 github 页面域 (username.github.io),因此当我访问该域时,它会创建一个 github domain -> custom domain -> github domain .....
循环作为 github 域自动重定向到自定义域。将 CNAME 值更改为我的自定义域解决了问题