ご覧いただきありがとうございます。お知恵をお貸しください。
前提・実現したいこと
WPでURLを変更したいと考えています。
WPをインストールしたディレクトリ:https://xxx.com/wp/
WPを表示させたいディレクトリ:https://xxx.com/blog/
発生している問題・エラーメッセージ
以下の作業を行いました。
- 管理画面から「サイトアドレス (URL)」の変更
- /wp/ から、 index.php と .htaccess をダウンロード
- /blog/に、修正したindex.php と .htaccess の2ファイルをアップロード
その結果、以下のような状況です。
- 投稿、カテゴリ一覧などの下層ページについては、/blog/ で正しく表示される
- TOPページのみ500
パーマリンク設定を変更すると、/blog/にアップした .htaccess が自動的に修正され、
全ページが500エラーになります。
ソースコード
▼ /blog/index.php(修正してアップしたもの)
<?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/wp-blog-header.php' );
▼ /blog/.htaccess(下層ページが正しく、TOPが500状態のとき)
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wp/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp/index.php [L] </IfModule> # END WordPress
▼ ./blog/htaccess(パーマリンク更新後、全ページ500状態のとき)
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] </IfModule> # END WordPress
補足情報
/blog/配下には、サイトリニューアル前の状態のファイル一式が存在しています。
(MovableTypeで作られたものです)
もしかして、何らかの影響があるのでしょうか…?
よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/03/18 00:03
2019/03/20 00:28