sudo nano /etc/apache2/sites-available/default
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverrideAll (Replace this word None to All)
Order allow,deny
allow from all
</Directory>
Save (Ctrl+x+enter) then restart apache service
Step 2:- // all Directories: go to file location Ex. cd /var/www/project folder path (then run this command)
find . -type d -exec chmod 755 {} \;
//All Files:
find . -type f -exec chmod 644 {} \;
And Enable Mod_rewrite mode
How to enable mod_rewrite for Apache 2.2 order to use mod_rewrite you can type the following command in the terminal:
sudo a2enmod rewrite
Restart apache2 after
sudo service apache2 restart
sudo /etc/init.d/apache2 restart