HOW TO: configure IIRF on IIS6 for Drupal and WordPress – Clean URLS

Clean URLSThis is a complete walk-through to get Ionic Shades IIRF clean and friendly URL rewriter up and running in just a few minutes. This is specifically written for Windows 2003 Server/IIS 6 and it has a complete and working example of the code you need to use for your IsapiRewrite4.ini file. If you just need the IsapiRewrite4.ini code you can skip to the end and just copy and paste, but this post might make a useful check list.

This configuration will allow you to host multiple websites on IIS6, whether the solution is for Drupal or WordPress – I’m hosting several sites on a Windows 2003 server and IIRF is works and completely free!
  1. Create a directory on your server – SERVER\c$\Inetpub\wwwroot and arbitrarily name it ‘ISAPI
  2. Right click on the newly created ISAPI folder and select Properties > Security tab > Add
    1. Now click on the Advanced button
    2. You’ll now see the Advanced dialogue box. Select Object Types
    3. Click the box that says Computers
    4. And then click OK
    5. Next click on the Find Now button, scroll down the list until you find IIS_WPG and IUSR_YourComputerName
    6. Now click OK. and then OK again to add those names you have just selected
    7. And now select the user Internet Guest Account – IUSR_YourComputerName and give it the following permissions: Modify, Read & Execute, List Folder Contents, Read, Write
    8. Click OK
If you want to use IIRF with multiple websites, just create a folder inside your ISAPI folder and call it yourdomainname and place the files IsapiRewrite4.dll and IsapiRewrite4.ini in there. Once you’ve created the new directory, open the IsapiRewrite4.ini file and paste the following code in there:
RewriteCond %{HTTP_HOST} ^(www\.yourdomainname\.com).*$ [I]
RedirectRule ^/(.*)$$1 [I,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(?!favicon.ico$)([^?]*)(?:\?(.*))?$ /index.php?q=$1&$2 [L]

RewriteCond %{HTTP_HOST} ^(yourdomainname\.com).*$ [I]
RedirectRule ^/(.*)$$1 [I,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)$ /index.php/$1 [L]

Just make sure you have your IsapiRewrite4.dll and IsapiRewrite4.ini in the same folder. You won’t have any trouble at all; this code will work. If there’s any chance you have a problem, re-boot your server.
Now onto configuring IIS
  1. Open your Internet Information Services (IIS) console.
  2. Open your websites folder and select website
  3. Right click on your website and select Properties
  4. Now go to the ISAPI Filters tab and click the Add button.
  5. Under Filter name: put some text in (this text is arbitrary, but it’s useful to put something appropriate in such as Ionic Shade’s IIRF).
  6. Then click on the Browse button and locate the file IsapiRewrite4.dll which is in your newly created ISAPI folder and click OK.
That’s it! You’re all setup for Clean URLs!

18 thoughts on “HOW TO: configure IIRF on IIS6 for Drupal and WordPress – Clean URLS

  1. After study a few of the blog posts on your website now, and that i truly as if your way of blogging. I bookmarked it to my bookmark website list and will also be checking back soon. Pls check out my web site as well and tell me what you think.

  2. Like a Newbie, I’m always searching on the internet for articles that will help me. Congratulations for posting this type of useful weblog. Your site isnt only informative and also very artistic too. There normally are extremely handful of individuals who can write not so simple articles that creatively. Keep up the great work !!

  3. Nice blog here! Also your website loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my website loaded up as fast as yours lol

Leave a Reply