How to enable mod_rewrite for Apache 2.2

后端 未结 15 1360
渐次进展
渐次进展 2020-11-21 07:09

I\'ve got fresh install of Apache 2.2 on my Vista machine, everything works fine, except mod rewrite.

I\'ve uncommented

LoadModule rewrite_module mo         


        
15条回答
  •  南方客
    南方客 (楼主)
    2020-11-21 07:18

    Just noticed you said mod_rewrite.s instead of mod_rewrite.so - hope that's a typo in your question and not in the httpd.conf file! :)

    I'm more used to using Apache on Linux, but I had to do this the other day.

    First off, take a look in your Apache install directory. (I'll be assuming you installed it to "C:\Program Files" here)

    Take a look in the folder: "C:\Program Files\Apache Software Foundation\Apache2.2\modules" and make sure that there's a file called mod_rewrite.so in there. (It should be, it's provided as part of the default install.

    Next, open up "C:\Program Files\Apache Software Foundation\Apache2.2\conf" and open httpd.conf. Make sure the line:

    #LoadModule rewrite_module modules/mod_rewrite.so
    

    is uncommented:

    LoadModule rewrite_module modules/mod_rewrite.so
    

    Also, if you want to enable the RewriteEngine by default, you might want to add something like

    
        RewriteEngine On
    
    

    to the end of your httpd.conf file.

    If not, make sure you specify

    RewriteEngine On
    

    somewhere in your .htaccess file.

提交回复
热议问题