我有冲突RewriteRule .htaccess。
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.php [L]
RewriteRule ^unsubscribe.php$/template/site.org/newsletter/unsubscribe.php
RewriteRule ^(unsubscribe)/?$ /$1.php [L,NC]
此
RewriteRule . /index.php [L]
与
冲突RewriteRule ^unsubscribe.php$/template/site.org/newsletter/unsubscribe.php
RewriteRule ^(unsubscribe)/?$ /$1.php [L,NC]
请帮我解决。
答案 0 :(得分:2)
您的unsubscribe
规则需要在模式和目标之间留出空格,但更重要的是,您需要在全部index.php
规则之前放置这些规则。您还可以将最后两个规则合并为一个:
RewriteEngine on
RewriteBase /
RewriteRule ^unsubscribe(?:\.php)?$ /template/site.org/newsletter/unsubscribe.php [L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.php [L]