以下是我的htaccess,Redirect 301不起作用。任何想法?
order allow,deny allow from all Options -Indexes Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . index.php [L] Redirect 301 /index.php?id=4 site.com/newdirectory/
答案 0 :(得分:1)
order
指令。此外,您无法匹配Redirect
RewriteCond
mod_rewrite
指令中的查询字符串,而不是这样:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^id=4$ [NC]
RewriteRule ^index\.php$ /newdirectory/? [L,NC,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]