This is a quick question. How do I change the .htaccess
file to rewrite everything to redirect it to the index.php
file?
When I'm removing the line of RewriteCond
I'll get an 505 Internal Server Error
.
This is my .htaccess
file:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
You can use this rule:
RewriteEngine on
RewriteCond %{REQUEST_URI} !\.(?:jpe?g|gif|bmp|png|ico|tiff|css|js)$ [NC]
RewriteRule !^index\.php$ index.php [L,NC]
RewriteCond
will skip this rewrite for image/css/js files.!^index\.php$
means match anything except index.php
.