Rewriting to a contained vdir - impossible?

Topics: User Forum
Mar 2, 2010 at 10:16 AM


I'm running IIRF on IIS 6, mostly with satisfaction - however there is one niggle I can't seem to get past though I'm not sure it's actually IIRF's fault.

In order to 'secure' a web application written in the Symfony framework, most of the application typically lives outside the webroot. I've created a virtual directory that maps to the Symfony project's webroot within another site's document root, thus:

http://site/ with http://site/webapp/ for the web app. As far as I'm aware this vdir is not configured as an application-containing vdir.

However, though IIRF is functional for http://site, I cannot seem to make IIS pass requests through IIRF when the request is for anything under http://site/webapp/. IIRF does not log (so I assume does not see) the requests, even though the rules are valid and read by IIRF. The site's IIRF.ini looks like this, ported from Symfony's bundled .htaccess:


# we skip all files with .something except .html
RewriteBase /

RewriteCond %{URL} /webapp/.*\..+$
RewriteCond %{URL} (?!/webapp/.*\.html$).*
RewriteRule /cms/(.*) /webapp/$1 [L]

# we keep the .php files unchanged
RewriteRule /webapp/(.*\.php)(.*) /webapp/$1$2 [L]

# finally we redirect to our front web controller
RewriteRule /webapp/(.*) /webapp/index.php/$1 [L]


What am I doing wrong? Is this just a strange behaviour of IIS?

Many thanks 

Mar 2, 2010 at 10:40 AM

You'll have to forgive my idiocy, it seems the mere act of posting a request for help has helped me figure out the problem in the first place. The vdir /was/ configured to hold an application, so expected its own Iirf.ini. I'd previously given it one, but it was badly written and I missed the telltale entries in the log.

Sorry for the spam!

Mar 2, 2010 at 12:30 PM

glad you solved it