ISAPI Rewrite for Expression Engine

I use Expression Engine (or EE) for many of my blogs, and I mostly use a WIMP setup (and I know the LAMP users love that acronym).

WIMP = Windows, IIS, MySQL, PHP
LAMP = Linux, Apache, MySQL, PHP

While I do have a LAMP box, I also use SQL Server and .NET, so a couple of my WIMP boxes are a bit more than well… WIMP-y, for lack of a better term.

EE has a nasty default URL.  It would look something like this:
yourfunkydomain.com/index.php?/templategroup/templatename/article-title

Most people want to get rid of the /index.php? and I can’t blame them.

IIS doesn’t have mod_rewrite for URL rewriting, but there is ISAPI Rewrite and it’s very powerful, if not on par with mod_rewrite.  I’ve posted my methods in the past for when I used Wordpress and decribed them when I added an All Posters front to hockeyfights.com.

I was reading the EE forums on pmachine.com today and saw someone asking specifically about getting rid of the /index.php? with ISAPI Rewrite and IIS and thought I’d post my method here:

First, it’s helpful to read the wiki entry about removing posts from your URLs.

Second, go into your control panel and remove index.php from any of the urls defined for your blog.

Third, in the control panel set “Force URL query strings” to no.

Fourth, get your httpd.ini file ready to go with this code:


[ISAPI_Rewrite]
RewriteRule (/(?:template1|template2|trackback|member|search|P\d{1,8}).*) /index.php?$1 [I,L]

That’s it smile

I’m using what the wiki entry describes as the inclusion method because I use many other directories that aren’t associated with EE and I don’t want anything related to them.  For someone like me who only has a few templates per domain, it’s not a big deal.  For someone who might use many template groups and names, it’ll be a little more work, or they might want to look into using another method.

Posted by David M Singer on Nov 15, 2006 at 06:02 PM

Comments

<< Back to main