After a bit of pain, my great hosting admin and I have managed to get Ionic ISAPI Rewriting Filter (IIRF) 2.0.1.1013 RELEASE working on IIS v6.0. I thought I would post how we got it working; and hopefully our solution will help you!
I had the site working on a different type of server before I started, so I ran into some trouble with my existing Drupal configuration. So, if you also already have the site set up somewhere else, make sure you do the following before moving to the new server:
Disable Clean URLs in Drupal's Admin -> Site Configuration -> Clean URLs
If you have the Global Redirect module turned on, make sure you set the "Non-clean to Clean" option to "Off" at Admin -> Site Configuration -> Global Redirect
Here are the steps that we took to get it working:
Followed the instructions in the guide. The guide is included in the ZIP file at AdminGuide > Help > IirfGuide.chm. We used the IirfGlobal.ini file quoted at the end of this post.
Restarted IIS
Created an Iirf.ini file in the root folder of the site, entering only StatusUrl /iirsStatus RemoteOk. We then tested to see if IIRS was working by going to http://mysite.example.com/iirsStatus. It should print out some status lines for you.
Changed the Iirf.ini file to it's final form, as quoted at the end of this post
Turned on Clean URLs again. Don't turn on Global Redirect's "Non-clean to Clean" option though! It will redirect the page endlessly.
IirfGlobal.ini:
RewriteEngine ON
RewriteFilterPriority DEFAULT
NotifyLog OFF
Iirf.ini:
# Do not pass to drupal if the file or directory exists
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Handle query strings on the end
RewriteRule /(.*)\?(.*)$ /index.php\?q=$1&$2 [I,L]
# now pass through to the generic handler
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)$ /index.php?q=$1 [I,L]
There's some documentation on Drupal's site about using clean URLs in II6 that I'm currently using. Check out http://drupal.org/node/3854.
The short answer is download ISAPI Rewrite 2 lite from http://www.isapirewrite.com/. The lite version only lets you configure one set of rewrite rules for your entire IIS configuration, but works well and is free.
The paid version lets you specifiy rewrite rules for each site you have configured in IIS, but required more configuration of IIS.
There's more information in this post, which goes on: "You also need to install a hotfix to correct REQUEST_URI behaviour when using PHP via the FastCGI module. See KB954946 for more information. A symptom of this problem is when all form submissions get redirected to the frontpage of the site."
A quick google search returned this guide, Drupal Clean URL's on IIS. Is this helpful?
After a bit of pain, my great hosting admin and I have managed to get Ionic ISAPI Rewriting Filter (IIRF) 2.0.1.1013 RELEASE working on IIS v6.0. I thought I would post how we got it working; and hopefully our solution will help you!
I had the site working on a different type of server before I started, so I ran into some trouble with my existing Drupal configuration. So, if you also already have the site set up somewhere else, make sure you do the following before moving to the new server:
Global Redirect
module turned on, make sure you set the "Non-clean to Clean" option to "Off" at Admin -> Site Configuration -> Global RedirectHere are the steps that we took to get it working:
StatusUrl /iirsStatus RemoteOk
. We then tested to see if IIRS was working by going tohttp://mysite.example.com/iirsStatus
. It should print out some status lines for you.Global Redirect
's "Non-clean to Clean" option though! It will redirect the page endlessly.IirfGlobal.ini:
Iirf.ini:
There's some documentation on Drupal's site about using clean URLs in II6 that I'm currently using. Check out http://drupal.org/node/3854.
The short answer is download ISAPI Rewrite 2 lite from http://www.isapirewrite.com/. The lite version only lets you configure one set of rewrite rules for your entire IIS configuration, but works well and is free.
The paid version lets you specifiy rewrite rules for each site you have configured in IIS, but required more configuration of IIS.
The ISAPI rules I'm using are:
If your Drupal installation was installed under a subdirectory, you'd want to adjust these rules a bit.
I have used Ionic Rewrite for a while now... it's free and works great
http://www.codeplex.com/IIRF
I managed to implement this by installing the URL rewriter module and creating a web.config file in the base directory with this code:
There's more information in this post, which goes on: "You also need to install a hotfix to correct REQUEST_URI behaviour when using PHP via the FastCGI module. See KB954946 for more information. A symptom of this problem is when all form submissions get redirected to the frontpage of the site."
IIRF is a free URL rewriter, works on IIS and works with drupal.