# BEGIN Bootbeta
<IfModule mod_rewrite.c>
DirectoryIndex index.html index.php
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST}  ^example.com$ [NC]RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^abc/(.*)$ abc/$1.php#RewriteCond %{QUERY_STRING} ^name=(.+) [NC]
#RewriteRule ^domain.php$ /domain/%1? [R=301,L]
</IfModule>
# END Bootbeta我想输入 localhost/123456后
调用localhost/del.php处理页面,但url还是123456
del.php取得这个123456
就像空间博客一样解析是怎么做的高手帮看一下,在线泪奔等~~~~~~~~~~~~

解决方案 »

  1.   


    RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^/zph/(\d+)/?$ /del.php?id=$1&%1 [L,NC]修改后服务器需要重启才能生效
      

  2.   

    http://blog.chinaunix.net/uid-20157058-id-1974554.htmlOptions +Includes
    SetOutputFilter INCLUDES
    AcceptPathInfo OnAcceptPathInfo On
    AcceptPathInfo On
    AcceptPathInfo OnAcceptPathInfo On
      

  3.   

    写错了,不好意思,应该是RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^/(\d+)/?$ /del.php?id=$1&%1 [L,NC]
      

  4.   


    不对啊
    我的内容是这样的
    # BEGIN Bootbeta
    <IfModule mod_rewrite.c>
    DirectoryIndex index.html index.php
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    #RewriteCond %{HTTP_HOST}  ^mydomain.com$ [NC]RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^/(\d+)/?$ /index.php?id=$1&%1 [L,NC]ErrorDocument 404 /404.html
    </IfModule>
    # END Bootbeta
    我输入localhost/123456
    后跳到了404
    我输入localhost/index.php?id=123456
    可以正常访问
    没匹配上???
      

  5.   

    根本连apache都不用重启
    RewriteRule ^(.*)(\d+)/?$ http://localhost/del.php?id=$1$2 [L]
    我这一句话就能改,可是你的两句老跳到404去,改不成
    现在发现,我只是让del处理,并不是要改URL RewriteRule不是重改吗
    伪静态啊
      

  6.   

    解决了,一句话就行了,不用重启任何东西
    RewriteRule ^([0-9]+)/?$ test.php?id=$1 [L]
    测试localhost/123456
    url不变
    调用的是test.php也能正确得到123456