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, 2471 views
Visitor's picture
asked by Visitor
42 weeks 4 days ago



3 Answers

Answer
+1

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

Visitor's picture
answer by Visitor
42 weeks 3 days ago
  • You need to restart apache afterwards:
    /etc/init.d/apache2 restart

    - lightnin 13 weeks 4 days 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
    42 weeks 3 days 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
    42 weeks 3 days 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 40 weeks 1 day ago
  • Asked by

    Visitor's picture
    Visitor

    View in your own language!