views:

22

answers:

2

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

A: 

Maybe with that, every file with 4 letter extension would not head to bootstrap.php

RewriteEngine on    
RewriteRule !\.[\d]{4}$ bootstrap.php
markcial
+1  A: 

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]
icyfeel