^t_(d+).html$ t.php?id=$1
这个在apache下面可以,但在iis下的isapi_rewrite里可能就不对了
要改成 ^(.*)/t_(d+).html$ $1/t.php?id=$2
加了/,和对?进行了转义
Apache下
RewriteRule ^company/show_([0-9]+).html$ company.php?uid=$1 [L] //正确,可以不转义. ?
RewriteRule ^company/show_([0-9]+).html$ company.php?uid=$1 [L] //正确
RewriteRule ^/company/show_([0-9]+).html$ /company.php?uid=$1 [L] //错误 加了/就不行了
IIS下
RewriteRule ^(.*)/resume/([0-9]+)/show.html$ /$1/person.php?pid=$2 [L] // 正确
RewriteRule ^(.*)/resume/([0-9]+)/show.html$ /$1/person.php?pid=$2 [L] //错误,.?必须转义
RewriteRule /resume/([0-9]+)/show.html$ /person.php?pid=$1 [L] // 正确
RewriteRule resume/([0-9]+)/show.html$ person.php?pid=$1 [L] // 错误,必须加/
RewriteRule /resume/([0-9]+)/show.html$ /person.php?pid=$1 [L] // 错误,?必须转义
总结 iis下必须加 /,.?必须转义
apache下不能加/
博客主要讲述了内容修改相关事宜,提到某些情况需添加逗号并对内容进行转义,同时总结出特定情况下必须添加、转义,而另一种情况不能添加。
3535

被折叠的 条评论
为什么被折叠?



