如何解决我在MediaWiki .htaccess文件中使用RewriteCond的问题?

以下是我们的.htaccess文件的相关部分:

 RewriteEngine On RewriteBase / RewriteRule ^download.shtml /en/downloads [R] # Don't rewrite requests for files in MediaWiki subdirectories, # MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt RewriteCond %{REQUEST_URI} !^/(stylesheets|images|skins)/ RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html RewriteCond %{REQUEST_URI} !^/favicon.ico RewriteCond %{REQUEST_URI} !^/robots.txt # Rewrite http://wiki.domain.tld/article properly, this is the main rule RewriteRule ^(.*)$ /index.php/?title=$1 [L,QSA] 

问题是,我们正在反对现有的MediaWiki规则,而且我很难说出实际情况。 问题似乎是,当我们访问download.shtml时,它会将我们带到一个 wiki页面,但是会说“当前在这个页面上没有文字”。 实际上当我使用/en/downloads访问页面时,它显示我们的下载页面。

您可能想尝试为downloads.shtml页面添加条件,以便在第二个重写规则中忽略它。 像这样的东西。

 RewriteCond %{REQUEST_URI} !^/downloads.shtml