自定义域Github页面

自定义域Github页面

本文介绍了自定义域Github页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我按照来设置与Github页面。根据他们的,我试图使用自定义子域名进行设置。



我通过GoDaddy购买了我的域名,并使用他们的DNS管理器工具在主机下添加了myappname.github.io (CNAME):





我没有改变任何东西,例如A(主机)下的IP地址。

最后,在我的Github页面上,当我进入设置时,它正确地显示您的网站发布在www.myappname.com下。

然而,当我去www.myappname.com ,我看到以下内容:



我做错了什么?

编辑:



挖掘输出:

  dig www.myappname.co 

; <<>> DiG 9.8.3-P1<>> www.myappname.co
;;全局选项:+ cmd
;;得到的答案:
;; - >> HEADER<< - 操作码:QUERY,状态:NOERROR,ID:19874
;;标志:qr rd ra; QUERY:1,ANSWER:3,AUTHORITY:0,ADDITIONAL:0

;;问题部分:
; www.myappname.co。在A

;;答案部分:
www.myappname.co。 3600 IN CNAME myappname.github.io。
myappname.github.io。 3600 IN CNAME github.map.fastly.net。
github.map.fastly.net。 18中A 199.27.76.133

;;查询时间:198毫秒
;; SERVER:10.2.0.4#53(10.2.0.4)
;;时间:2015年3月17日11:08:00
;; MSG SIZE rcvd:120


解决方案

您的DNS配置为重定向您的GitHub Pages站点中的 www 子域名,但是您的GitHub页面 CNAME 文件指定您的应用程序应该在顶点上运行域, myappname.com 。这会导致另一个重定向到apex域,正如你在你的问题中指出的那样,它有自己的 A 记录指向一个非GitHub IP地址。



正如我们所讨论的,一种可能的解决方案是更新存储库中的 CNAME 文件以使用 www.myappname。 com 而不是 myappname.com ,然后设置从apex域到 www subdomain。



这将导致对 myappname.github.io myappname .com 重定向到 www.myappname.com ,您的网站居住在那里。


So I've followed the directions for setting up a custom domain with Github Pages. As per their recommendation, I'm attempting to set this up using a custom subdomain.

I purchased my domain through GoDaddy, and using their DNS Manager tool I added myappname.github.io under Host (CNAME):

I didn't change anything else, such as that IP address under A (Host).

Lastly, on my Github page when I go under settings it correctly says "Your site is published under www.myappname.com"

Yet, when I go to www.myappname.com, I see the following:

What did I do wrong?

Edit:

Output from dig:

dig www.myappname.co

; <<>> DiG 9.8.3-P1 <<>> www.myappname.co
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19874
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.myappname.co.      IN  A

;; ANSWER SECTION:
www.myappname.co.   3600    IN  CNAME   myappname.github.io.
myappname.github.io.    3600    IN  CNAME   github.map.fastly.net.
github.map.fastly.net.  18  IN  A   199.27.76.133

;; Query time: 198 msec
;; SERVER: 10.2.0.4#53(10.2.0.4)
;; WHEN: Tue Mar 17 11:08:00 2015
;; MSG SIZE  rcvd: 120
解决方案

Your DNS is configured to redirect the www subdomain to your GitHub Pages site, but your GitHub Pages CNAME file specifies that your application should run on the apex domain, myappname.com. This causes another redirection to the apex domain, which as you point out in your question has its own A record pointing to a non-GitHub IP address.

As we discussed, one possible solution is to update the CNAME file in your repository to use www.myappname.com instead of myappname.com and then set up a redirect from the apex domain to the www subdomain.

This will cause requests to myappname.github.io and myappname.com to redirect to www.myappname.com, where your site lives.

这篇关于自定义域Github页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 10:52