###前提・実現したいこと
ドメインの変更がありbefore.comからafter.comに移行しました。
サーバーの設定でhttps://after.comの公開ディレクトリをafterに設定しました。
その下層にanother_dirを作成し、こちらにWPをインストールいたしました。
一般設定でサイトのURLをhttps://after.comとしてあります。
WordPress アドレス (URL)はhttps://after.com/another_dirとなっております。
移行前も構造は同じです。
移行前は問題なかったのですが、移行後管理画面で記事一覧のページ送りやソートをするとURLが書き換わり404になってしまいます。
本来は下段のようになるはずが上段のようになってしまいます。
例)
https://after.com/wp-admin/edit.php?post_type=page&orderby=date&order=desc
https://after.com/another_dir/wp-admin/edit.php?post_type=page&orderby=date&order=desc
移行後に起きた問題なのでリダイレクトのために書いた.htaccessが原因ではないかと考えているのですが、
その先が分からない状態です。
サイトの表示自体は問題なくできております。
お力添えいただけますと幸いです。
#before.comの.htaccess
before.comと結びついているbeforeディレクトリ内.htaccessにリダイレクト用の記述をしました。
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^(before.com)(:80)? [NC] RewriteRule ^(.*) https://after.info/$1 [R=301,L] </IfModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>
WPをインストールしているbefore/another_dirでは下記の通り記載しています。
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^(beofre.com)(:80)? [NC] RewriteRule ^(.*) https://after.com/$1 [R=301,L] </IfModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /another_dir/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /another_dir/index.php [L] </IfModule> # END WordPress
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/08/31 10:10