[Apache-Users 7646] Re: .htaccess のrewriteルール
fujioka
qhtsige @ apost.plala.or.jp
2010年 3月 13日 (土) 13:48:18 JST
藤岡です。早速の竜@コンプネットさんごへんじありがとうございます。
> 以下の様にしてみるとどうですか
> RewriteRule ^([0-9A-Za-z_\.'=-%]+)\.html$ htmpage2.php?yspec=$1 [L]
試してみましたが、同じInterbal servererrorで
RewriteRule: cannot compile regular expression
'^([0-9A-Za-z_\\.'=-%]+)\\.html$'
となります。
なお、現用中の
^([0-9A-Za-z_.'=-]+)\.html$ htmpage2.php?yspec=$1 [L]
で、 http://localhost/Asparagus_sp.1.html
のURLでは、ピリオドがあっても、所望のとおり変換されています。(htmpage2.php?yspec=Asparagus_sp.1)
^([0-9A-Za-z_\.'=-\%]+)\.html$ htmpage2.php?yspec=$1 [L]
としても同じなので、正規表現中に%記号が使えないことを意味しているようです。
Apache-Users メーリングリストの案内