網域轉寄不適用於 github 頁面

網域轉寄不適用於 github 頁面

我在 github 頁面上使用自訂網域創建了我的博客blog.tamizhvendan.in,今天我www.p3programmer.com透過CNAME使用www.p3programmer.com.新域名運作良好。

由於這是一項重大更改,我希望進行網域重定向,將舊網域重定向到新網域。我已經使用他們的網域轉送系統在我的 DNS 伺服器 (BigRock) 中配置了相同的內容。之後,tamizhvendan.in正確重定向到github 頁面,www.p3programmer.comblog.tamizhvendan.in導致 404。根據 BigRock 的文檔,子域將被重定向到路徑www.example.com\{subdomain},即在這種情況下它應該重定向到www.p3programmer.com\blog但它沒有重定向。

我已經CNAME在帳戶中新增了一筆記錄tamizhvendan.in,其值指向www.p3programmer.com但仍收到 github 頁面的 404 頁面錯誤。

這是我的挖掘輸出blog.tamizhvendan.in

; <<>> DiG 9.10.1-P2 <<>> blog.tamizhvendan.in +nostats +nocomments +nocmd
;; global options: +cmd
;blog.tamizhvendan.in.          IN      A
blog.tamizhvendan.in.   2658    IN      CNAME   www.p3programmer.com.
www.p3programmer.com.   1818    IN      CNAME   tamizhvendan.github.io.
tamizhvendan.github.io. 427     IN      CNAME   github.map.fastly.net.
github.map.fastly.net.  30      IN      A       23.235.44.133

挖掘產出www.p3programmer.com

;; global options: +cmd
;www.p3programmer.com.          IN      A
www.p3programmer.com.   1740    IN      CNAME   tamizhvendan.github.io.
tamizhvendan.github.io. 349     IN      CNAME   github.map.fastly.net.
github.map.fastly.net.  30      IN      A       23.235.40.133

答案1

答案2

Github 似乎只支援每個儲存庫一個外部網域,至少根據他們的文件是這樣的將 CNAME 檔案新增至您的儲存庫

請注意,CNAME 檔案中只能有一個網域。

blog.tamizhvendan.in所以你需要一個用 301來應答所有請求的頁面:

HTTP/1.1 301 Moved Permanently
Location: http://www.p3programmer.com/

相關內容