If you’re like me, then you are useless at remembering a couple of things which tend to start a project. I recently found the “FallbackResource” command in Apache.

This single command replaces the mod_rewrite rules:

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase /
	RewriteRule ^index\.php$ - [L]
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule . /index.php [L]

with the single command

FallbackResource /index.php

I can remember that one! It basically does the same thing – If the file does not exist (any file, such as css/images/PHP scripts) then it will route it to index.php.

2 thoughts on “Fallback Resource

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>