见下
#escape the . so it does not match indexsphp etc
#added [NC,L] so it is not case sensitive and last rule processed
RewriteRule ^index\.php$ test.php [NC,L]
#added [NC,L] so it is not case sensitive and last rule processed
# and QSA to pass through any existing query string values
RewriteRule ^project-([0-9]+)\.html$ project.php?id=$1 [L,NC,QSA]
以下编辑代码如果这个规则
重写规则^ project.php?ID = 82 $ test.php的
旨在仅当id = 82时匹配,则它将不起作用并且需要被重写如下
#if the query string has an id=82
RewriteCond %{QUERY_STRING} id=82 [NC]
#and resource is project.php, send it to test.php
RewriteRule ^project\.php$ test.php [NC,L]
编辑
我想借project.php?ID = 82,并切换到项目82.html
下面
#if the original request has project.php
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /project\.php [NC]
#capture the id param
RewriteCond %{QUERY_STRING} id=([0-9]+) [NC]
#and 301 redirect to project-id.html
RewriteRule . project-%1.html? [L,R=301]
对于非显而易见的问题有时需要来设置[RewriteLog](http://httpd.apache.org/docs/2.0/mod/mod_rewrite的.html#rewritelog)。 – mario 2012-01-06 19:08:52