日期:2014-05-17  浏览次数:20971 次

100分求一个rewrite正则
www.host.com/u/1243

=>

www.host.com/user.php?id=1243

------解决方案--------------------
RewriteRule /u/([0-9]*) /user.php?id=$1 [I]
------解决方案--------------------
RewriteRule /u/(\d*) /user.php?id=$1 [I]
------解决方案--------------------
RewriteRule ^/u/([0-9]+)$ /user.php?id=$1 [PT]
------解决方案--------------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/u/([0-9]+)$ $1/user\.php\?id=$2
</IfModule>