URL redirect

我原本有個 website ( www.abc.def.domain.com ) , 剛做左個新 website ( www.def.domain.com ) , 想將所有指去舊 website 既都 redirect 去新 website , 請問係咪要係 DNS 可以做到 ? 大概係點做 ?

Thanks

小學程度學寫html類似咁
  1. <html>
  2. <head>
  3.    <title>HTML Redirect</title>
  4.    <meta http-equiv="refresh" content="3; url = www.def.domain.com " />
  5. </head>
  6. <body>
  7.    <h1>WELCOME TO www.abc.def.domain.com</h1>
  8.    <p>you'll be redirected to www.def.domain.com in 5 seconds.</p>
  9. </body>
  10. </html>
複製代碼

TOP

小學程度學寫html類似咁
TH30 發表於 2023-1-31 10:41



    如果咁樣 , 我咪要保留舊 website ? 我係唔想保留舊 website

TOP

TOP

可以用DNS CNAME

TOP

當 兩組 c or a record 指去同一ip後.
apache bind 左呢2個domain 去同一個.  
直接 用.htaccess 去 rewrite 個 domain 由 a 去b.

https://wpscholar.com/blog/redir ... omain-via-htaccess/

有點類似 http -> https 的 寫法。

TOP

如果係 nginx 嘅話,參考
https://ubiq.co/tech-blog/redirect-url-nginx/

TOP

以上方法都係要保留原有 website , 咁樣會一直用住個 host 同 IP .
但其實可以在 DNS server 上要改設定做 re-direct 嗎 ?

TOP

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


咪俾佐你囉, 又唔睇

TOP

咪俾佐你囉, 又唔睇
tunster 發表於 2023-2-3 12:06



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

thanks

TOP