0

Figured out that my .htaccess was not working due to mod_rewrite not installed on my ubuntu desktop. How to install and enable mod_rewrite?

3 answers, 0 votes, 781 views
Visitor's picture
asked by Visitor
18 weeks 1 day ago



3 Answers

Answer
0

Open a terminal and type the following command
 
sudo a2enmod rewrite
 
This will enable rewrite module for apache

Visitor's picture
answer by Visitor
18 weeks 15 hours ago
Answer
0

Open terminal & follow this :
#sudo gedit /etc/apache2/sites-enabled/000-defaultCheck for these lines & change as I have done here :
 DocumentRoot /var/www/        <Directory />                Options FollowSymLinks                AllowOverride all        </Directory>        <Directory /var/www/>                Options FollowSymLinks                 AllowOverride all                Order allow,deny                allow from all        </Directory>        Save the file & restart apache :
#sudo /etc/init.d/apache2 restart

Visitor's picture
answer by Visitor
18 weeks 14 hours ago
Answer
0

There is a Bug in apache while using a2enmod, it doesn't make any
changes, so I am following these steps from last 1 year everytime I
reinstall ubuntu. May be they fixed it in new version. But these steps works 100%
Open terminal & follow this :
#sudo gedit /etc/apache2/sites-enabled/000-default
Check for these lines & change as I have done here : 
DocumentRoot /var/www/        <Directory />                Options FollowSymLinks                AllowOverride all        </Directory>        <Directory /var/www/>                Options FollowSymLinks                 AllowOverride all                Order allow,deny                allow from all        </Directory> Save the file & restart apache :
#sudo /etc/init.d/apache2 restart

Visitor's picture
answer by Visitor
18 weeks 14 hours ago
  • Yep, in addition to the above answer, one must add AllowOverride All to <Directory> tag in the /etc/apache2/sites-enabled/000-default file

    - Visitor 15 weeks 5 days ago
  • Asked by

    Visitor's picture
    Visitor

    View in your own language!