求一个htaccess规则/tel/index.php?id=4  转换成下面这样/4__tel/index.php

解决方案 »

  1.   

    RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^.*/([0-9]+)__tel/index.php /tel/index.php?id=$1 [QSA,L]
      

  2.   

    例子。
    http://vipcha22.net.id351.alias.yunhosting.com/tel/index.php?id=44http://vipcha22.net.id351.alias.yunhosting.com/44__tel/index.php好像不行阿。。急急
      

  3.   

    apache 配置文件中的 rewrite_module   开了吗?
      

  4.   

    rewrite_module
    这个要怎么看?  应该都开的了
      

  5.   

    方法1.    
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
    RewriteRule ^(.*)/([0-9]+)__tel/index.php $1/tel/index.php?id=$2 [QSA,L]方法2.
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteBase /tel/
    RewriteRule ([0-9]+)__tel/index.php index.php?id=$1 [QSA,L]
    .htaccess和tel 放在同目录下