http://hoge.net/hoge/hoge.php?date=0228
をhttp://hoge.net/hoge/hoge.php/date/0228
のような形で表示したい。(この表示で上記URLと同じ表示をしたい)
どのような記述を.htaccessへ行えばよいですか?
以下でどうでしょうか?
RewriteEngine On
RewriteRule ^hoge\.php/date/([0-9]+)$ index.rb?date=$1
すいません。コピペ時の修正に誤りがありました。
以下ではどうでしょう?
RewriteEngine On RewriteRule ^hoge\.php/date/([0-9]+)$ hoge.php?date=$1
1で頂いたコメントを理解できているかいまいち自信が無いのですが、以下はどうでしょう?
RewriteEngine On RewriteRule ([^/]+)/\1.php/date/([0-9]+)$ $1/$1.php?date=$2
おー、上のでいけました。ありがとうございます。
回答者 | 回答 | 受取 | ベストアンサー | 回答時間 | |
---|---|---|---|---|---|
1 | toohigh | 291回 | 274回 | 37回 | 2006-07-31 08:44:49 |
なんかできないみたいです。。。
私の書き方がいけなかったのかもしれません。
http://hoge.net/fuga/fuga.php?date=0228
をhttp://hoge.net/fuga/fuga.php/date/0228
全部hogeではなく、下の二つが同じ名前なんですがそれは関係してますかね?