今回はhtmlにwordpressを組み込みました。
その際に使用したもの。
■zirei○○.htmlをzireiにリダイレクト
html版からwordpress版などに移行した際に使えます。
RedirectMatch permanent /zirei(.*).html /zirei
<解説>
. : 何でもいい1文字
- : 直前の文字が0個以上繰り返されることを示す
→ .* : どんな文字列も対象
■. ○○.html をルートディレクトリにリダイレクト
RedirectMatch permanent (.*).html $1/
<解説>
(hoge) : hogeを$1の引数として渡す
→ $1 = hogeとなります。
【追記】
Redirect と RedirectMatchの違いは
正規表現が使えるかどうか。
Rediret : 正規表現使用不可
RedirectMatch : 正規表現使用可