网站http://www.example.com/在 CMS 上运行,一切都通过 .htaccess 中设置的规则进行。访问http://www.example.com/时,根据用户的语言设置将用户重定向到以下路径之一:
http://www.example.com/en/
http://www.example.com/fr/
和目录实际上并不存在,它们由 CMS 处理/en/。/fr/
我正在向investors/站点添加一个新部分 ( ),但现在不希望它通过 CMS,但我不希望用户注意到它。
原始 .htaccess 文件有以下几行:
# never rewrite for existing files, directories and links
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
# rewrite everything else to index.php
RewriteRule .* index.php [L]
/en/investors/如果请求的路径以or开头,我设法使它不通过 CMS /fr/investors/:
# never rewrite for existing files, directories and links
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
# rewrite everything else to index.php
# except investors' section
RewriteRule ^(?!\/en\/investors|\/fr\/investors).+ index.php [L]
我将我的/en/investors/and/fr/investors/目录上传到服务器上,它们工作正常,但现在主页已损坏,因为/en/and/fr/目录现在存在。如何向该规则添加例外?