我来过这里:How to exclude a specific file in htaccess
在这里:exclude files from rewrite rule in .htaccess
但都没有奏效。我可能做错了什么?
.htaccess文件:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^wp-content(/.*|)$ - [L] # don't take any action
RewriteRule ^wp-admin(/.*|)$ - [L] # don't take any action
RewriteRule ^wp-includes(/.*|)$ - [L] # don't take any action
RewriteCond %{REQUEST_URI} !^/pureplantessentials\.html$
RewriteRule ^moreinfo/(.*)$ http://www.kgstiles.com/moreinfo$1 [R=301]
RewriteRule ^healthsolutions/(.*)$ http://www.kgstiles.com/healthsolutions$1 [R=301]
RewriteRule ^(.*)\.html$ $1/ [R=301]
RewriteRule ^(.*)\.htm$ $1/ [R=301]
</IfModule>
答案 0 :(得分:30)
要排除文件,请尝试以下操作:
RewriteCond %{REQUEST_URI} !^/pureplantessentials\.html$
如果文件为pureplantessentials.html
,则会跳过该规则。