WordPressを複数インストールした場合の.htaccessの配置の仕方

サーバーのルートディレクトリ
/home/onko2/www/onko/

onko.jpのwordpress
/home/onko2/www/onko/wp

この.htaccessは/home/onko2/www/onko/に置く
必要ぶぶんのみ記述
RewriteEngine On RewriteBase / RewriteRule ^index.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

同じ位置に配置dするindex.phpは

必要部分のみ

define( ‘WP_USE_THEMES’, true );

/** Loads the WordPress Environment and Template */
require( dirname( FILE ) . ‘/wp/wp-blog-header.php’ );

となる。

次に

onko.jp/aceのwordpress
/home/onko2/www/onko/wp/ace

この.htaccessは/home/onko2/www/onko/aceに置く、このディレクトリは必要となる

RewriteEngine On RewriteBase /ace/ RewriteRule ^index.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /ace/index.php [L]

同じ位置に配置するindex.phpは

define(‘WP_USE_THEMES’, true);

/** Loads the WordPress Environment and Template */
require( ‘/home/onko2/www/onko/wp/ace/wp-blog-header.php’ );

となる。
requireではサーバールートからのace/wp-blog-header.phpを記述する。

これでOK