mod_rewrite fun
I had a sub-folder that I wanted to tuck files into, but serve them up via apache without the requests having to have the sub-folder name, in essence, hide the fact there was a sub-folder there.
After applying my head to the brick wall for several hours I finally got it working.
The sub-folder is “million”, here’s the .htaccess entries that are applicable:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !/million/.*
RewriteCond %{REQUEST_URI} !/index.php
RewriteCond %{DOCUMENT_ROOT}/million/%{REQUEST_URI} -f
RewriteRule (.*) /million/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Leave a Comment