@xenon: you are right, but i'm just throwing out another approach on how to go about filtering with mod_rewrite. I honestly don't know what is going on with the C.jpg -> C.php but i don't see why that would imply that it is for denying access to a file?
Clarity...
What I really meant was, "Here is a basic start at a .htaccess file that shows a different approach to redirecting traffic thru a front controller."
Code:
RewriteEngine on
Options FollowSymLinks
## IF
## URL does not exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
## THEN
## Rewrite to bootstrap
RewriteRule ^(.*)$ index.php/$1 [PT,L,QSA]
So then if you take your .jpg->.php rule and stick it in...
Code:
RewriteEngine on
Options FollowSymLinks
###### YOUR RULE ######
RewriteRule images/C.jpg images/C.php [NC]
## IF
## URL does not exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
## THEN
## Rewrite to bootstrap
RewriteRule ^(.*)$ index.php/$1 [PT,L,QSA]
as long as C.php exists then everything is kosher.
2 cents:
I don't see the reasoning for the jpg->php change? I guess i am missing it or something. i realize that this will keep the image from getting served but wouldn't it be easier to just place it somewhere else instead of checking every request? Using this method it will NEVER get served to any request. It isn't like it is being filtered to only be served to a certain IP or what-not. It just seems a bit pointless, thats all.
good luck, justin