To enable the rewrite module, run "apache2 enable module rewrite":
sudo a2enmod rewrite
To apply the changes, you must restart the web server:
sudo service apache2 restart
VirtualHost should be like ServerName localhost.myproject.dev ServerAdmin webmaster @localhost
DocumentRoot /var/www/project_path <Directory /var/www/project_path> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /app.php [QSA,L] </IfModule> </Directory>
this parameter redirects your index.php, index.html or something else:
Options Indexes FollowSymLinks MultiViews
he will rewrite your htacces!
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /app.php [QSA,L] </IfModule>
source share