RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
"""""""""
添加 301 重定向規則,
https://example.com/舊網址壹
https://example.com/新網址壹
https://example.com/舊網址貳
https://example.com/新網址貳
https://example.com/舊網址參
https://example.com/新網址參
直接給我完整 .htaccess 文件。
# 301 Redirects
RewriteRule ^舊網址壹/?$ /新網址壹/ [R=301,L]
RewriteRule ^舊網址貳/?$ /新網址貳/ [R=301,L]
RewriteRule ^舊網址參/?$ /新網址參/ [R=301,L]
4.
WordPress
網站:使用有轉址功能的外掛、或編輯 functions.php