我有一个在共享主机上安装MediaWiki的个人网站。 Apache配置使用PHP 4处理所有.php请求,使用PHP5处理所有.php5请求。将所有.php流量重定向到.php5文件
为了兼容性的原因,我需要能够使用.php扩展名,但MediaWiki只能在PHP5上使用。我试图使用mod_rewrite引擎,但我坚持规则。
下面是当前文件:
DirectoryIndex index.php5
RewriteEngine on
# This rewrites URIs in the form /pages/Article_Name to /index.php5?title=Article_Name.
RewriteCond %{REQUEST_URI} !^/pages/index.php5.*$ [NC]
RewriteRule ^pages/?(.*)$ /index.php5?title=$1 [L]
# This is the broken rule
RewriteCond %{REQUEST_URI} ^index\.php(([^5])(.*))?$ [NC]
RewriteRule ^index\.php(([^5])(.*))?$ /index.php5?$1 [L]
规则的想法是“重定向从index.php文件的所有内容(后面没有‘5’)index.php5”。
有什么想法?
编辑:
SetEnv PHP_VER 5
的作品,但我仍然有兴趣的原因的规则是没有考虑到。
不错的尝试,但它似乎工作(可能在服务器上被禁用) – Luk 2009-02-09 21:12:19
按理说不,我是一个完整的Apache noob,所以我可能做错了。我将它添加到DirectoryIndex行下面,并尝试使用和不使用我的规则。 – Luk 2009-02-09 21:14:09