RewriteEngine on
RewriteBase /
RewriteRule ^([a-zA-Z0-9]+)$ article.php\?id=$1
===============
上面有错吗?xxx.com/1234567转向article.php?id=1234567
为什么配置好后也不行,是安装了mod_rewrite的,
另外我怎么在命令行里查看apache安装在什么地方?

解决方案 »

  1.   

    RewriteRule ^([a-zA-Z0-9]+)$ article.php?id=$1左斜線可以不用加不過建議這樣寫
    RewriteEngine on  
    RewriteRule ^/([a-zA-Z0-9]+)$ /article.php?id=$1我不知道.htaccess支不支持 RewriteBase
    我做虛擬主機時,就不支持RewriteBase另:如果是桌面機的話,就用搜索功能吧
    如果是LINUX機 就用find命令查找 apache
    應該能找到吧,呵呵
      

  2.   

    还是不行,不知道怎么检查rewrite有没有工作?
      

  3.   


    不需要重启,如果没有达到预期的效果,一定是rewrite写错了查看httpd命令所在
    # which httpd至于更正,最简单的情况如下:
    RewriteEngine on 
    RewriteRule ^([a-zA-Z0-9]*)$ article.php?id=$1 [L]
      

  4.   

    我記得要用.htaccess還需要在apache裏設置什麼才能生效
    好像是在httpd.conf裏把 AllowOverride None 将None改为 All
    我也不太確定,你試一下吧. 不行再BAIDU或G下我不太喜歡用.htaccess
      

  5.   

    AllowOverride None 讲None改为 All      //在APACHE里面去配置
                    <Directory "D:/server/apache/cgi-bin">
                                      AllowOverride none  改   AllowOverride ALL                            Options None
                                      Order allow,deny
                                       Allow from all
                     </Directory>
    好像是這個設置了apache就要重啟哦
      

  6.   

    单单编辑了 .htaccess ,是不需要重启apache的
      

  7.   

    是你要在http.conf下把你的路径更改 在重写啊 htaccess编译不需要重启