Well, I have just finished a very frustrating 3 afternoon slog, doing battle with an IIS 6.0 server running Helicon ISAPI_Rewrite version 2. I am happy to report that I got it working fantastically. Here is the result of my labours:
# These rewrite rules took 3 afternoons to write!
#Please do not edit them without saving them first.
# uploaded files
RewriteCond Host: (?:www\.)?example\.com
RewriteRule »
^/([_0-9a-zA-Z-]+)/files/(.+) /wp-includes/ms-files.php?file=$2
RewriteRule ^/files/(.+) /wp-includes/ms-files.php?file=$1 [L]
# Redirect wp-admin to ensure it has a trailing slash
RewriteCond Host: (?:www\.)?themegacentre\.com
RewriteRule ^/([_0-9a-zA-Z-]+/)?wp-admin$ /$1wp-admin/ [I,RP,L]
# Rewrite admin areas etc to the right files
RewriteCond Host: (?:www\.)?themegacentre\.com
RewriteRule »
^/([_0-9a-zA-Z-]+/)?(wp-admin|wp-content|wp-includes|wp-login\.php)(.*) »
/$2/$3 [I,L]
# Rewrite all other requests to the wordpress index.php files
RewriteCond Host: (?:www\.)?themegacentre\.com
RewriteCond %{REQUEST_URI} »
!(wp-admin|wp-includes|wp-content|wp-login\.php|/files/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [I,L]
# Linebreaks which are not supposed to be
# there are marked »
# please remove them if you've just copied and pasted!
It is beautiful. It is ingenious. It is untested with uploaded files, but we’ll cross that bridge when we come to it.
Please note that these files were not placed in a .htaccess file, but in the httpd.ini which is located in C:\Program Files\Helicon\ISAPI_Rewrite on that particular server.
I hope it helps someone out there who is currently pulling out their hair in terrible frustration!
Any questions or comments, please let me know. If you find a bug, or make an improvement, or find a feature that these rewrites don’t support — please tell me!