リダイレクトの基本的な記述
2011/07/28
htaccessに記載するときの簡単のヤツのまとめ。
指定したページを恒久的にリダイレクト(301リダイレクト)
「Redirect permanent」を使う。
トップページのアクセスをtips.recatnap.infoへ301リダイレクト
Redirect permanent / https://tips.recatnap.info/
test.htmlのアクセスをtips.recatnap.infoへ301リダイレクト
Redirect permanent /test.html https://tips.recatnap.info/
指定したページを一時的にリダイレクト(302リダイレクト)
「Redirect temp」を使う。
トップページのアクセスをtips.recatnap.infoへ302リダイレクト
Redirect temp / https://tips.recatnap.info/
test.htmlのアクセスをtips.recatnap.infoへ302リダイレクト
Redirect temp /test.html https://tips.recatnap.info/
任意のページを恒久的にリダイレクト(正規表現+301リダイレクト)
「RedirectMatch permanent」と正規表現を使う。
流れ的に302だと「RedirectMatch temp」で良いんだろうね。
全ページのアクセスをtips.recatnap.infoへ301リダイレクト
RedirectMatch permanent /(.*) https://tips.recatnap.info/
その他
こっちは他のサイトになりますが「リダイレクトチェック」