How to enable mod_rewrite for Apache 2.2

后端 未结 15 1329
渐次进展
渐次进展 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:25

    Open terminal and typin a2enmod rewrite, It will enable your mod_rewrite module for Apache.

    Then go to /etc/apache2/sites-available and edit default file. (For this you must have writable permissions to this file and sites-available folder.)

    Replace below with existing lines 4 to 14

    DocumentRoot /var/www
    
    Options FollowSymLinks
    AllowOverride All
    
    
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    
    

    Now restart your apache by /etc/init.d/apache2 restart or service apache2 restart

    Take clean URL test again and this time it will be passed.

提交回复
热议问题