URLが「https://example.com/index.php」となった場合リダイレクトしないようにしたいです。
現在の記述は、index.htmlと、indexが含むURLがリダイレクトするようになっていますが、index.phpと入力されたときのみリダイレクトを無効にしたいです。わかる方いましたら教えてほしいです。
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]
試した記述 index.phpが含まれたURLはリダイレクトしていました。
RewriteCond %{REQUEST_URI} !^(.*).(index|php)$ [NC] 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]
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/19 10:06