ISAPI Rewrite for WordPress

One of the biggest perks of running Apache as opposed to IIS is a nice native rewrite engine.  Apache’s mod_rewrite can make most urls super-clean in just a few lines.  Luckily IIS has a decent answer for it, although not native.  ISAPI Rewrite from Helicon Tech is an ISAPI filter that works in a very, very similar manner as mod_rewrite.  They have a free version, the biggest drawback being you can’t use it site-to-site, it’s only for global rewrites.  The full version, currently at $69 (with some decent discounts starting at just 2 server licenses) allows you to go site-to-site with the filter.

I found a few leads about how people translated mod_rewrite for WordPress to ISAPI rewrite.  Few were doing me any good until I came across DA Williams’ post at Blue Crescent Tech.  In fact, I was able to almost use his rules out of the box.  For one thing, I did not have to delete the line relating to the comments feed that he said he had to delete.  The other was that it seemed he had no line to rewrite the main feed link that WordPress uses.  Following the simple conversion instructions he left I was able to add it back into my httpd.ini file easily.

What I added to my httpd.ini file:

RewriteRule /archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?category_name=$1&feed=$2 [I,U,O]
RewriteRule /archives/category/?(.*) /index.php?category_name=$1 [I,U,O]
RewriteRule /archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?author_name=$1&feed=$2 [I,U,O]
RewriteRule /archives/author/?(.*) /index.php?author_name=$1 [I,U,O]
RewriteRule /archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [I,U,O]
RewriteRule /archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [I,U,O]
RewriteRule /archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/trackback/?$ /wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [I,U,O]
RewriteRule /feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1 [I,U,O]
RewriteRule /comments/feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1&withcomments=1 [I,U,O]

I’m glad I got it working here, seems to be giving me no troubles and is super fast (so far).  I hope to implement this on quite a few other sites.

Posted by David M Singer on Aug 23, 2004 at 01:08 AM

The trackback URL for this entry is:

Trackbacks:

Comments:

  1. <trackback >Help for installing and customizing WordPress
    5 minute installationhttp://wiki.wordpress.org/5MinuteInstallationThe "Kubrick" Theme http://binarybonsai.com/archives/2004/09/05/kubrick-v125/Figuring out which sites to ping http://www.wiki.wordpress.org/UpdateServicesHow to show/output the…

    Posted by The Evolution of Success on Sep 24, 2004 at 03:09 PM
Commenting is not available in this weblog entry.

Next entry: Will DVDs Be In Your Future?

Previous entry: The Palm

<< Back to main