我當前的.htaccess檔案代碼如下:
### ISPConfig folder protection begin ###
AuthType Basic
AuthName "Members Only"
AuthUserFile /var/www/web113/web/.htpasswd
require valid-user
### ISPConfig folder protection end ###
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
</IfModule>
我想將 URL 重定向http://xxxxx.xxxxxx.net/local-attraction到http://xxxxx.xxxxx.net/pages/local-attraction
我試過
RedirectPermanent http://xxxxx.xxxxxx.net/local-attraction http://xxxxx.xxxxx.net/pages/local-attraction
還與
Redirect 301 /local-attraction http://xxxxx.xxxxx.net/pages/local-attraction
但沒有任何效果,它顯示的是 404 頁面。
uj5u.com熱心網友回復:
您應該mod_rewrite為此重定向使用規則,因為您已經在 .htaccess 中使用它:
RewriteEngine On
RewriteRule ^local-attraction/?$ /pages/$0 [L,NC,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/379757.html
下一篇:Mule4中的重定向鏈接
