現在、 特定のURLは指定したURLへリダイレクト、それ以外はトップページへリダイレクトをさせるような
.htaccessを書きたく奔走しております。
例)
http://example.com/detail/1/
http://example.com/detail/2/
http://example.com/detail/5/
というURLを
http://example.jp/detail/1/
http://example.jp/detail/2/
http://example.jp/detail/5/
へリダイレクトし、それ以外をTOPへリダイレクトさせる。
試したこと
Redirect permanent /detail/1/ http://example.jp/detail/1/
Redirect permanent /detail/2/ http://example.jp/detail/2/
Redirect permanent /detail/3/ http://example.jp/detail/5/
Redirect permanent / http://example.jp/
上記にすると全てが新規のトップページへ転送されてしまいます。
.htaccessは途中に一致するリダイレクトがあった場合でも最後までチェックしてしまうのでしょうか?
上記を実現するにはどのようにすればいいのかお知恵をお貸しいただけますでしょうか?
よろしくお願いいたします。
※mod_rewriteは使用可能です。
環境
OS: centos6.5
PHP:5.3
Apache2.2
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/04/25 04:35
2017/04/25 04:42 編集
2017/04/26 12:38