我有这些工作重写规则:
# Allow access to assets folder from plugins folders
RewriteRule ^app/plugins/(.+)/assets - [L]
# forbid access to files and folders under app
RewriteRule ^app/.*$ - [L,F]
# rewrite to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?action=$1 [L,QSA]
现在我想从这些规则中排除位于http://www.mywebsite.com/wordpress/下的所有内容......因此我添加了一个新的重写条件:
...
# rewrite to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^\/wordpress\/ [NC]
RewriteRule ^(.*)$ index.php?action=$1 [L,QSA]
但它不起作用。当我尝试访问这样的内容时: http ://www.mywebsite.com/wordpress/contact-us/
它会将我重定向到 index.php ...
任何帮助将非常感激。