Using IIRF for blog in a subdirectory

Topics: User Forum
Jan 9, 2009 at 3:42 AM
Hello Cheeso, and all!
I had great success with IIRF for a subdomain wordpress blog I was working on.  you can checkout that thread here

But I have another question on using IIRF

I have an e-commerce site running at, and I used the IIRF rewrite for it's blog at  and it also worked out great.  However, now I need to create a wordpress installion in a subdirectory instead of a subdomain.  My VPS runs IIS6, 2.0.

So how can I get the wordpress install to work in a subdirectory and use IIRF for the pretty urls?  The site does have php installed.

I did try an experiment.  I applied IIRF to the root of the domain, in hopes that since there where no other rules applied but for wordpress, that the root domain urls would not be affected, but the subdirectory would get the benefit.  Didn't work.  As soon as I applied it, the site "dissapeared" giving me a no site exists here error when I browsed it.

Is there a way to write the ini file to bypass or completely disregard the root directory and all of it's files, and only affect one subfolder?

Thanks for any help.

Sep 21, 2009 at 10:22 PM


Seem to be having the same issue! Did you ever find a solution?


Nov 10, 2009 at 3:01 PM

I too run into the same problem. I tried to install Drupal at the sub-directory with IIRF ini at the root level, I got the error that the site not exit no networking connection. Even I put IIRF ini with Drupal at the sub-directory , still I get the same error. It only works when I move everything IIRF ini + Drupal files and folder up to the root level.

So, I think that IIRF doesn't work with sub-directory. If you all hav any clue on this please share.

Thank you.

Nov 10, 2009 at 3:52 PM

give me the IIRF.ini file you are using, once again, please?


Nov 10, 2009 at 4:26 PM

Cheeso, mind to take at look at IIRF ini I'm using?


# DrupalRules.ini
# from redamo
# remember to rename this file to IsapiRewrite4.ini ,
# or copy this content to a file named IsapiRewrite4.ini
# before using it!
# Fri, 11 May 2007 12:42

RewriteLog C:\IIRFLOG\iirfLog.out
RewriteLogLevel 3
RewriteFilterPriority HIGH

# Accept a url with the following directories and pass them through unchanged.
RewriteRule ^/misc/(.*)$ /misc/$1 [I,L]
RewriteRule ^/files/(.*)$ /files/$1 [I,L]
RewriteRule ^/modules/(.*)$ /modules/$1 [I,L]
RewriteRule ^/themes/(.*)$ /themes/$1 [I,L]
RewriteRule ^/sites/(.*)$ /sites/$1 [I,L]
RewriteRule ^/uploads/(.*)$ /uploads/$1 [I,L]
RewriteRule ^/css/(.*)$ /css/$1 [I,L]
RewriteRule ^/images/(.*)$ /images/$1 [I,L]

# for modules that provide their own js (tinymce,img assist etc)
RewriteRule ^(.*\.js)$ $1 [I,L]
RewriteRule ^(.*\.gif)$ $1 [I,L]
RewriteRule ^(.*\.png)$ $1 [I,L]
RewriteRule ^/modules/tinymce/(.*)$ /modules/tinymce/$1 [I,L]

# Make URLs sane
RewriteRule ^/cron\.php$ /cron.php [I,L]
RewriteRule ^/index\.php\?q\=(.*)$ /index.php?q=$1 [I,L]
RewriteRule ^/update\.php\?op\=(.*)$ /update.php?op=$1 [I,L]
RewriteRule ^/update\.php /update.php [I,L]
RewriteRule ^/xmlrpc\.php /xmlrpc.php [I,L]

RewriteRule ^/robots\.txt /robots.txt [I,L]

# Handle query strings on the end
RewriteRule /(.*)\?(.*)$ /index.php\?q=$1&$2 [I,L]

# now pass through to the generic handler
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)$ /index.php?q=$1 [I,L]


Even though I tried to insert this RewriteBase /drupal/ or RewriteBase /  before thise line # Accept a url with the...., still no luck.

Nov 11, 2009 at 7:53 AM
Edited Nov 11, 2009 at 7:54 AM

RewriteBase is not supported by IIRF.

You can replace ^/ with ^/drupal (or whatever your directory is) in each rule to make this work.

ps: Please don't open multiple threads for the same question.  I read them all. 


Nov 11, 2009 at 5:28 PM

OK, I got it. Thanks for the reply.


Dec 15, 2009 at 10:41 AM
Edited Dec 15, 2009 at 12:46 PM


I have the same problem as iplex, but I cannot just replace ^/ with ^/mysubdir because I have one site as root (e.g. and another in a subdirectory (e.g. Is there a workaround for this?

I have the same iirf.ini (even though the file is named IsapiRewrite4.ini)

Thanks a lot in advance!


EDIT: I have solved my problem removing the 'L' flag from the subfolder rewriterules:

# Do not pass to drupal if the file or directory exists
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Handle query strings on the end
# firstly for the subfolder without the L flag
RewriteRule /mysubfolder/(.*)\?(.*)$ /mysubfolder/index.php\?q=$1&$2 [I]
# then for the root
RewriteRule /(.*)\?(.*)$ /index.php\?q=$1&$2 [I,L]

# now pass through to the generic handler
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# firstly for the subfolder without the L flag
RewriteRule ^/mysubfolder/(.*)$ /mysubfolder/index.php?q=$1 [I]
# then for the root
RewriteRule ^/(.*)$ /index.php?q=$1 [I,L]

Dec 15, 2009 at 2:40 PM

Thanks for the tip.

For everyone's information, There's a workitem that's been created to track the request for RewriteBase:

I'm not sure that adding a new directive, akin to RewriteBase, is the right thing to do for IIRF.  It makes the product more complicated to deploy and test.  There are solutions available today, and they are not so difficult.

A RewriteBase directive wouldn't have solved THIS problem, for example.