2

我有一个来自 Namecheap.com 的域,并通过 github 页面托管了一个页面。有时我的页面无法加载并给出“重定向太多”错误。我认为问题出在我的高级 DNS 中的某个地方。看看它 -在此处输入图像描述

基本上,我有 2 条 A 记录指向 Github 的 IP 地址,一条 CNAME 记录指向 mygithubusername.github.io,还有一条 URL 重定向记录指向我的域。我究竟做错了什么?

4

3 回答 3

1

我有同样的问题,解决方案是在我的 github CNAME 文件中,我必须更改我的网页标题。因此,在我将其更改为“www.mywebpage.hu”(在没有“www.”之前)之后,不再发生重定向问题。我检查了您的 CNAME,但您没有“www”。同样,如果你用这个来完成你的标题,也许它会有所帮助。

于 2019-04-08T10:36:31.123 回答
1

据我所知,问题来自 URL 重定向记录。当试图到达www.akshayud.me它时,它会重定向到akshayud.me,当它到达 URL 重定向时,它会重定向回www.akshayud.me,它会重定向到akshayud.me并进行无限循环。

要解决它,请从 DNS 中删除 URL 记录(这是我的首选解决方案)或修复从 www 到 Web 服务器级别的根的重定向。这是我的 wget 输出(我只使用 URL 记录 IP 来保证 URL 重定向记录的 100% 使用):

$ 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]
于 2017-12-19T06:07:33.893 回答
0

我遇到了同样的麻烦,就我而言,

我如何修复:

错误出现在我的 CNAME 记录中。我将 CNAMEwww指向我的 github 页面域 (username.github.io),所以当我点击域时,它会创建一个循环,github domain -> custom domain -> github domain .....因为 github 域会自动重定向到自定义域。将 CNAME 值更改为我的自定义域解决了问题

于 2021-04-12T07:02:46.830 回答