2017-09-13

[.htaccess] 跳轉到新主機

最近幫客戶轉機器用到紀錄一下..

feather-34999_1280

不帶參數直接跳轉:

RewriteEngine on 
RewriteRule ^(.*)$ http://www.newdomain.com/ [R=301,L]

帶入網址後面的資料跳轉

RewriteEngine on 
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]


reference:

https://stackoverflow.com/questions/1945568/htaccess-redirect-all-pages-to-new-domain

--

The bug existed in all possible states. Until I ran the code.

如果這篇文章有幫助到您幫我分享一下,讓我有寫下去的動力...