ルート以外にインストールしたWordPressをルートで表示
| サーバーのローカルパス | %DocumentRoot%/wp |
|---|---|
| WordPress のアドレス (URL)[3] | http://www.example.com/wp |
| サイトのアドレス (URL)[4] | http://www.example.com |
設定→一般 サイトアドレスをルートに変更すること!
index.phpを修正
index.phpを%DocumentRoot%(以下ルートディレクトリ)へ移動する。移動したindex.phpファイルを修正する。
require('./wp-blog-header.php'); → require('./wp/wp-blog-header.php');
htaccessを修正
htaccessファイルをルートディレクトリに移動する。
移動したhtaccessに書き込み権限があれば[ダッシュボード] > [設定] > [パーマリンク]の更新で自動更新される。
書き込み権限がなければ手動で修正する。
# 修正前RewriteEngine On RewriteBase /wp/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp/index.php [L] ------------------------------------------------------------------ # 修正後RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]