你只要自己搜索一下答案大把。同样的问题答得多了自然就懒了。'last|L' (last rule)
Stop the rewriting process here and don't apply any more rewriting rules. This corresponds to the Perl last command or the break command from the C language. Use this flag to prevent the currently rewritten URL from being rewritten further by following rules. For example, use it to rewrite the root-path URL ('/') to a real one, e.g., '/e/www/'.
--------------------------------------------------
'redirect|R [=code]' (force redirect)
Prefix Substitution with http://thishost[:thisport]/ (which makes the new URL a URI) to force a external redirection. If no code is given a HTTP response of 302 (MOVED TEMPORARILY) is used. If you want to use other response codes in the range 300-400 just specify them as a number or use one of the following symbolic names: temp (default), permanent, seeother. Use it for rules which should canonicalize the URL and give it back to the client, e.g., translate ``/~'' into ``/u/'' or always append a slash to /u/user, etc.

解决方案 »

  1.   

    RewriteRule ^([0-9a-zA-Z_-]+)\.html$ $1.php [L]
    RewriteRule ^http://localhost/s?id1=([0-9]+)&id2=([0-9]+)$ http://localhost/a.php?id1=$1&id2=$2 [L]
    RewriteRule ^http://localhost/html?([0-9]+)/([0-9]+).html$ http://localhost/a.php?id1=$1&id2=$2 [L]'L'标记是为了希望停止重写操作而立即重定向.
      

  2.   

    RewriteRule ^s?id1=([0-9]+)&id2=([0-9]+)$ a.php?id1=$1&id2=$2 [L]
    RewriteRule ^html?([0-9]+)/([0-9]+)\.html$ a.php?id1=$1&id2=$2 [L]
    为什么我也是这样的做,一直都不行呀??下面的就可以
    RewriteRule ^s'id1=([0-9]+)&id2=([0-9]+)$ a.php?id1=$1&id2=$2 [L]
    RewriteRule ^html'([0-9]+)/([0-9]+)\.html$ a.php?id1=$1&id2=$2 [L]
    把?改为'就行,难道?要用\?吗??
    可是改为\?也不行呀