Reputation: 925
The following RewriteRule redirects every request to bootstrap.php except the filextenstions between the parentheses
RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css|pdf|doc|txt|htm|html|xml|ttf|flv|swf|xml|ics|htc)$ bootstrap.php
Is it possible to exclude ALL files witouth declaring them like above?
So all requests should redirect to boostrap.php if the request is not a file
Upvotes: 0
Views: 696
Reputation: 91
Maybe you should check the file whether or not exists and is a regular file.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) bootstrap.php [L]
Upvotes: 3
Reputation: 9323
Maybe with that, every file with 4 letter extension would not head to bootstrap.php
RewriteEngine on
RewriteRule !\.[\d]{4}$ bootstrap.php
Upvotes: 0