2020-03-20

轉址 .htaccess 文件寫法參寫

轉址 .htaccess 文件寫法參寫


舉例要將 A DNS (sample.com)轉址到 B DNS (newsample.com)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sample\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.sample\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^/?$ "https\:\/\/newsample\.com\/" [R=301,L]

若 root內的資料夾 htaccess寫錯,即便設定 reDirect 301 也會造成404- Not Found轉址失效

  

搜尋關鍵字查找文章


 

訂閱本站文章

Please wait...

謝謝您的訂閱


Load WordPress Sites in as fast as 37ms!


海外廣告贊助
聯絡佛系行銷學苑

Study & Work with Me









    Copyright © 佛系行銷 freeday.cc 
    pencilenvelope