共有ホストにMediaWikiがインストールされた個人のWebサイトがあります。Apache構成は、すべての.phpリクエストをPHP 4で処理し、すべての.php5リクエストを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
動作しますが、ルールが考慮されなかった理由にまだ興味があります。