Difference Between A and CNAME

An A Record maps a hostname to one or more IP addresses, while the CNAME record maps a hostname to another hostname.

TOP

redirect 去果個一定係 IP address ? 唔可以指去 URL ?

thanks
peterchu1 發表於 2023-2-3 12:34


你自己入去睇下先啦, 唔睇就問

TOP

以上方法都係要保留原有 website , 咁樣會一直用住個 host 同 IP .
但其實可以在 DNS server 上要改設定做 ...
peterchu1 發表於 2023-2-3 11:17



    一個 IP 可以無限個 hostname,網頁嘅話你個 HTTP server 識應對就得,上面都有講過吓 Apache 或者 nginx 嘅做法
DNS 落 CNAME record 嘅話,可以指舊嘅 subdomain (例如你舉例嘅 www.abc.def.domain.com )參照返邊個 domain (例如你舉例嘅 www.def.domain.com

不過如果用 CNAME 做嘅話,會導致新舊 domain 都去到同樣網站,如果你想網址欄會自動 redirect 埋去新 domain,建議都係 HTTP server 層面做 redirect
如果個 HTTP server 不受你控制嘅話,最平嘅做法就係用 Netlify,舊嘅 subdomain 指去 Netlify,然後喺 Netlify 度做 redirect

TOP

如果要考慮SEO
應該係要回覆HTTP 301 指去新網址

TOP

之前用namecheap 係可以做到 但唔知係唔係間間都可以
https://www.namecheap.com/suppor ... a-url-for-a-domain/

TOP