<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)$ $1/archiver/index.php?$2                  (1)
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay.php?fid=$2&page=$3             (2)  
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread.php?tid=$2&extra=page\%3D$4&page=$3
(3)
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/space.php?$2=$3                            (4)
RewriteRule ^(.*)/tag-(.+)\.html$ $1/tag.php?name=$2                                            (5)
</IfModule>这是discuz的规则。。上面5行中 都有$ 符号 ,,还有$1,$2,$3...这都是什么意思啊?

解决方案 »

  1.   

    http://www.xxx.com/knowall/expertHotline/questionInfoView.jhtml?questionId=aaaaaid
    想换成
    http://www.xxx.com/ask/show.php?id=aaaaaidRewriteRule ^(.*)/knowall/expertHotline/questionInfoView.jhtml?questionId=$ http://www.xxx.com/ask/show.php?id=$1 
    这样写对不??
      

  2.   

    1.=================
    ^ 开始
    $ 结束
    比如 ^a.*b$ 表示匹配 以a开头,以b结束,任意字符在中间的字符串.
    2.==================
    $数字,表示反向引用,数字表示第几个括号,$数字表示第几个括号匹配到的内容^(a)(.*)(b)$ 匹配axxxb串,匹配成功,那么$1就是a字符,$2就是xxx字符串,$3就是b字符
      

  3.   

    http://www.xxx.com/knowall/expertHotline/questionInfoView.jhtml?questionId=1
    换成 
    http://www.xxx.com/ask/show.php?id=1
    RewriteRule ^(.*)/knowall/expertHotline/questionInfoView.jhtml?questionId=([0-9])$ &1/ask/show.php?id=$2 这样子写对不??
      

  4.   

    RewriteRule ^(.*)/knowall/expertHotline/questionInfoView.jhtml?questionId=(.*)$ $1/ask/show.php?id=$2 
    或者这样。。对不对?
      

  5.   

    这个不起作用 
    <IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteRule ^(.*)/time.php?userid=(.*)$ $1/Newtime.php?id=$2 
    </IfModule> 这样就可以 
    <IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteRule ^(.*)/time.php$ http://www.g.cn 
    </IfModule> 为什么加上参数就没作用了啊?