Monday, January 7, 2008

Friendly IIS

So I don't often talk about Windows technologies such as IIS but I thought today would be the exception. I guess I'm fairly competent with Windows technologies, so don't really come up against challenges like I do while using Linux... but the South Bend Server is actually running Windows Server 2003 and today I really struggled with something Apache finds quite simple; friendly URLs. The basic concept behind friendly URLs is taking an address such as http://www.theblueroom.us/index.php?title=User:Luke and creating a provision for it to be accessed at http://www.theblueroom.us/User:Luke. The benefits? Well apart from being shorter, the URLs are then more readily indexed by the robots and spiders that search engines use to index.

It became apparent after TBR began being indexed by Google that the page addresses had to get, well, friendly. MediaWiki pointed me in the vague direction of ISAPI rewriters for IIS and after a couple of failed installs/configurations the frustration was beginning to show. After navigating a wave of permission problems and ISAPI status errors in IIS Admin I was finally able to get the filter up and running.

As usual, it was a combination of solutions that seemed to click. Finding the WikiMedia subpage Short_URL/IIS6 and then comments located at the parent page enabled me to cobble together a working ini file with the rewriter IIRF. The solution creates short URLs when accessing articles only, and not functions... which I believe results in a more workable wiki. The working ini file directive follows:

RewriteRule ^/wiki/?([^\.]*)$     /wiki/index.php?title=$1 [L]

I'm just hoping now that performance isn't too badly affected by the rewriter. As far as I can tell there is an initial delay, and the rewriter then seems to cache in some way and speed returns to my perception of normal.

0 comments: