サイトの仕様上、静的ページとwordpressで表示しているサイトを扱っているのですが、「.htacces」に記述しているリダイレクトのコードが原因でwordpressで表示しているページがリダイレクトの影響を受けて表示されない問題が起きてしまいました。
■やりたい事
リダイレクトの記述を消すこと無く、wordpressで表示しているページのリダイレクトを無効にしたいです。
下記のディレクトリ構造の「page-contact.php」をwordpressの固定ページで出しています。
静的なページは問題なく、リダイレクトが効いているのですが、wordpressの固定ページを表示するとリダイレクトが効いてしまい表示がされないので、WPのディレクトリの中身をリダイレクト無効にする方法はありますか?わかる方がいましたら教えてほしいです。
■追記
問題となっているリダイレクトしてしまうURL
https://example.com/contact/
■ディレクトリ構造
web_site/
┣assets
┣about/
│ └index.html
┣company
│ └index.html
┣other
│ └index.html
┣business
│ └index.html
┣wp
│ └wp-admin
│ └wp-content
│ └themes
│ └site
│ └page-contact.php
│ └wp-includes
│ └.htaccess
│ └index.php
│ --省略--
┣index.html
┣.htaccess
■「web_site/.htaccess」の.htaccesコード
RewriteCond %{HTTP_HOST} !^example. [NC] RewriteRule ^(.*)$ https://example.com/$1 [R=301,L] # 末尾/を除外しリダイレクト RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(.*)/+$ https://example.com/$1 [R=301,L] # 存在しないディレクトリは上位へリダイレクト RewriteCond %{REQUEST_FILENAME}/ !-d RewriteCond %{REQUEST_FILENAME}/ en/ RewriteRule ^(.*)/+$ https://example.com/$1 [R=301,L] # 存在しないディレクトリはTOPへリダイレクト RewriteCond %{REQUEST_FILENAME}/ !-d RewriteRule ^(.*)/+$ https://example.com/$1 [R=404,L] # index.html除外へ正規化 RewriteCond %{REQUEST_URI} ^.*index.html/$ [NC,OR] RewriteCond %{REQUEST_URI} ^.*index$ [NC] RewriteRule ^(.*)index.html/$ https://example.com/$1 [R=301,L] RewriteRule ^(.*)index.*$ https://example.com/$1 [R=301,L] # 存在しないページは上位階層へリダイレクト RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.*)/(.*) https://example.com/$1/ [R=301,L] # httpsへ正規化 RewriteCond %{ENV:HTTPS} !^on$ [NC] RewriteRule ^(.*)$ https://example.com/$1 [R=301,L] DirectoryIndex index.html Options -Indexes
あなたの回答
tips
プレビュー