wordpress:install-subdirectory
サブディレクトリにインストールしURLはルートで表示
「https://example.com/wp」というサブディレクトリにWordPressをインストールし、「https://example.com」というルートのURLで表示する場合です。
- ダッシュボードの設定からサイトアドレスを「https://example.com」とルートのURLにする
- サブディレクトリ内にあるindex.phpと.heaccessファイルをルートディレクトリに複製
- ルートディレクトリのindex.phpの「wp-blog-header.php」のファイルパスにサブディレクトリを追記する
/** Loads the WordPress Environment and Template */ require __DIR__ . '/wp/wp-blog-header.php';
ルートにインストールしてからサブディレクトリに移す場合
- ダッシュボードの設定からWordPressアドレスを「https://example.com/wp」とサブディレクトリのURLにする
- FTPソフトを使って「wp」フォルダを作成し、WordPressのデータをすべて移動
- index.phpと.heaccessファイルをルートディレクトリに複製
- ルートディレクトリのindex.phpの「wp-blog-header.php」のファイルパスにサブディレクトリを追記する
/** Loads the WordPress Environment and Template */ require __DIR__ . '/wp/wp-blog-header.php';
wordpress/install-subdirectory.txt · 最終更新: by shimehitsu14