Last week while i was working on url rewriting i face the problem. I had written the rule in .htaccess but forget to enable the mod_rewrite. Remember your .htaccess rule will not work until you enable the mod_rewrite.
How to install apache2 on ubuntu
Go to terminal (ctrl+Alt+T) and write the following command
1 |
sudo apt-get install apache2 |
Once apache2 installation is complete. Write the command mentioned below to enable mod_rewrite
1 |
sudo a2enmod rewrite |
After enable the mod_rewrite do the changes on following file
1 |
vim /etc/apache2/sites-available/default |
1 2 3 4 |
Options Indexes FollowSymLinks MultiViews AllowOverride all /* By default AllowOverride none is written so delete none and write all*/</span> Order allow,deny allow from all |
After done the changes restart the apache.
To restart apache2
1 |
sudo /etc/init.d/apache2 restart |
Enable mod_headers in apache
1 |
sudo a2enmod headers |
Remember to restart apache
So to restart apache2 write through terminal
1 |
sudo /etc/init.d/apache2 restart |