I want any request to /files/ to be redirected to one php script, and all others (that aren't for specific file types) to be directed to another. No matter what I try I can't get this to work. This is from my apache2 virtual server config file:
<Directory /var/www/test/public>
RewriteEngine On
RewriteBase /files
RewriteRule ~files/(.+) file-handler.php?id=$1 [L,QSA]
RewriteRule !\.(pdf|gif|jpg|png|css|swf|txt|php|ico|html|js|xml|flv)$ /index.php?page=%{REQUEST_URI}
</Directory>
I also tried this:
<Directory /var/www/test/public>
RewriteEngine On
RewriteBase /
RewriteRule !\.(pdf|gif|jpg|png|css|swf|txt|php|ico|html|js|xml|flv)$ /index.php?page=%{REQUEST_URI}
RewriteBase /files
RewriteRule ~files/(.+) file-handler.php?id=$1 [L,QSA]
</Directory>