http://example.com/abc/にwordpressを設置しています。
表示はhttp://example.com/になるように、設定しています。
http://example.com/abc/にアクセスがあったとき、http://example.com/へ転送したいのですが、上手くいきません。
転送できたコード
RewriteEngine On RewriteRule ^test/(.*)$ http://example.com/ [R=301,L]
は転送されます。
http://example.com/test/→http://example.com/
転送できなかったコード
RewriteEngine On RewriteRule ^abc/(.*)$ http://example.com/ [R=301,L]
は転送されず、404になります。
http://example.com/abc/→404エラー
abcフォルダにwordpressをインストールしていることが関係しているのだと思われますが、なぜこのような動きになるのでしょうか。
http://example.com/abc/→http://example.com/
を実現するには、どうしたらよいでしょうか・・・???
■参考■abcフォルダ上階層の.htaccess
# 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> # END WordPress
■参考■abcフォルダ内の.htaccess
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /abc/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /abc/index.php [L] </IfModule> # END WordPress
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。