Check if file exists in a subdirectory

Topics: User Forum
Jul 15, 2010 at 3:08 PM
Edited Jul 15, 2010 at 3:13 PM
I'm using Iirf v2.0.1.15

I have the following directory structure where I have a library folder which contains my application, a webroot folder (which contains images, stylesheets etc) and an Iirf.ini config file:


I'm wanting to redirect all requests to /library/index.php if the file doesn't exist under webroot.


Request Response
/images/blah.png -> /webroot/images/blah.png
/news -> /library/index.php

My config looks like:

RewriteEngine ON

RewriteLog c:\path\to\folder\log\iirfLog
RewriteLogLevel 5

RewriteCond $0 !^/webroot
RewriteRule ^.*$ /webroot$0 [I]

RewriteCond $0 !-f
RewriteRule ^/webroot/(.*)$ /library/index.php [I,L,QSA]

And it's redirecting correctly to /library/index.php but it's not finding the files in webroot first.

Thu Jul 15 14:47:30 - 3444 - GenerateReplacementString: result '/webroot/images/buttons/submit.gif'
Thu Jul 15 14:47:30 - 3444 - EvalCondition: checking '/webroot/images/buttons/submit.gif' against pattern '!-f'
Thu Jul 15 14:47:30 - 3444 - EvalCondition: cond->SpecialConditionType= 'f'
Thu Jul 15 14:47:30 - 3444 - EvalCondition: Special: it is not a file

That file does exist at that location.

I have also tried testing using %{APPL_PHYSICAL_PATH} which results in C:\path\to\folder\webroot/images/buttons/submit.gif which also fails.

What's going on?