ヘルプ:WordPressとMediaWikiの共存

提供:EELの自由帳

メインページ > ヘルプ:目次  > WordPressとMediaWikiの共存

一つのサーバでWordpressとMediaWikiを共存させる。

「.htaccess」の内容

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase /
	RewriteRule ^index\.php$ - [L]

	# mediawiki
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteCond %{REQUEST_FILENAME} !-l
	RewriteRule ^wiki/(.*)$ /w/index.php?title=$1 [PT,L,QSA]
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteCond %{REQUEST_FILENAME} !-l
	RewriteRule ^wiki/*$ /w/index.php [L,QSA]

	# wordpress
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteCond %{REQUEST_FILENAME} !-l
</IfModule>

「index.php」の内容

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: /wiki/") ;
?>