サブディレクトリ(/wp/)にインストールしたwordpressをドメイン直下に表示する方法
【ルートディレクトリを変更】
サブディレクトリ(wordpressの一番上の階層)の中にある、index.php をエディタで開きます。
※念のため、バックアップをとっておきましょう。
index.php
/**
* Front to the WordPress application. This file doesn’t do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define(‘WP_USE_THEMES’, true);
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );
17行目の「/wp-blog-header.php」を
「/実際にwordpressが入っているサブディレクトリ/wp-blog-header.php」に変更します。
require( dirname( __FILE__ ) . ‘/wp/wp-blog-header.php’ );
変更できたら保存。
index.phpと.htaccess(index.phpと同じ階層にある)をドメイン直下に移動します。
これでルートディレクトリ(ドメイン直下)にサイトが表示されます☆


コメント