Update: This technique will work but will require more labor then just
running Apache.
I now run my Drupal under Apache under Windows 2003 Server.
I think I finally got around this problem (for now).
I could not figure out how to exactly translate the rules for Apache:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
In plain English: If the REQUEST_FILENAME variable does not exist (not an
existing File and not an existing directory) then apply the rule:
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
After much research this exact functionality does not appear to exist in any
ISAPI module for IIS. I think the following solution will help solve this issue.
It probably works with most "ISAPI rewrite" module.
With this approach you basically revert the "Apache Rewrite" logic. First
define rules for known files/folders (like /themes/ ..etc..). Have those
"matching rules" exit, so rules processing stops before going to the next
rule. With mod_rewrite.dll you can do that with the option [l].
Here is what my rules file looks (so far) like (using mod_rewrite.dll):
RewriteRule ^/index.php\?q\=(.*)$ /index.php?q=$1 [l]
RewriteRule ^/themes/(.*)$ /themes/$1 [l]
RewriteRule ^/misc/(.*)$ /misc/$1 [l]
RewriteRule ^/(.*)$ /index.php?q=$1 [l]
Remember, you have to add an "exiting" rule for all know folders/files before
hitting the final rule. The first rule is to avoid recursion and exit
immediately
if the URL already has index.php?q=.
To better understand the Apache rules here are the definitions of the main
options:
'last|L' (last rule)
Stop the rewriting process here and don't apply any more rewriting rules. Use
this flag to prevent the currently rewritten URL from being rewritten further by
following rules.
'qsappend|QSA' (query string append)
This flag forces the rewriting engine to append a query string part in the
substitution string to the existing one instead of replacing it. Use this when
you want to add more data to the query string via a rewrite rule.
REQUEST_FILENAME
The full local filesystem path to the file or script matching the request.
'-d' (is directory)
Treats the TestString as a pathname and tests if it exists and is a directory.
'-f' (is regular file)
Treats the TestString as a pathname and tests if it exists and is a regular
file.