IIS and Drupal – Enable Clean URL’s
To sum it all up I failed completely with the Lite version. I was banging my head against a wall, I’d tried everything. In the end by downloading the Full version (which has a 45 day free trial) everything started working instantly. I am hosting quite a few sites on my server and my new Drupal site wasn’t my default site so it might have been that that was messing things up.
*Update*
This post is now quite redundant. If you’re thinking of paying for the full version of ISAPI_Rewrite3 or even thinking of trying the free Lite version, I strongly suggest that you save yourself the time and effort and $99 and download Ionic Shade’s IIRF (which is very powerful, fully featured and completely FREE) and then follow this tutorial I’ve written for you, which will walk you through every step of the way of setting IIRF up on your Windows 2003 server.
Download the FULL, FREE version or IIRF from here:
http://cheeso.members.winisp.net/IIRF.aspx
Then follow my tutorial/walk-through for setting it up that works with Drupal (any version) and WordPress (any version)
http://www.caspianit.co.uk/iirf-drupal-and-iis6/
There is a free version of Mod Rewrite called ISAPI_Rewrite Lite that should get clean URLs working for IIS.
Just visit http://www.helicontech.com/download-isapi_rewrite3.htm and download the Lite version.
Just click on the link above, download the Lite version and copy to your server.
Then right-click on the .msi file and then click on install. If you host with an ISP you will need to get them to install it for you. (If they won’t do this consider pissing them of and hosting Drupal yourself on you own home computer – yes that’s right, self hosting is really the way to go as long as you’re not getting 2000 visits a day!) To find out how to do this have a look at: this post.
In the httpd.ini file which is probable located here "C:\Program Files\Helicon\ISAPI_Rewrite\" you will need to write to this so untick 'Read Only' in the file properties. Then add this code.
[ISAPI_Rewrite]
# Defend your computer from some worm attacks
RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP:Host} ^(?:www\.)?resorthotelsonline\.com$
RewriteCond %{HTTP:Host} ^(?:www\.)?sciencegossip\.co.uk$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Then in the file settings.php (which is part of the Drupal installation site\default\settings.php) you need to add the code at the bottom of the page:
// Isapi_Rewrite 3.x
if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
}If you’re using Drupal 6.x that’s it you’re good to go. You should be able to ‘Administer’ your website and enable friendly URLs.
Now someone might actually find you in the search engines!
All the best
Sci-Fi Si.
General configuration:
- Make sure
IIS_WPGandNETWORK SERVICEhave access to the .htaccess file – otherwise ISAPI_Rewrite cannot read the configuration httpd.ini (2.x) or .htaccess (3.x) files. - D5: Add
$conf['clean_url'] = 1to your settings.php – to manually enable clean urls. - D6: There are no changes required – it simply works.
Resources:
IIS CleanURLs using some of the available ISAPI filters.
Related posts:
- IIRF Drupal, WordPress and IIS6 – How to get them working first time – Guaranteed!
- Drupal – The selected file… could not be uploaded. Only JPEG, PNG and GIF images are allowed
- Access denied – Drupal 6.x
- Drupal Gmail Module – Solved.
- Drupal ‘white screen of death’ – error reporting for PHP
- GD library is listed twice. Drupal 6.14
- Beginning Drupal
Tags: drupal
Leave a Reply
Hot Topics
- Creating a Drupal 6 custom login form – Step by Step tutorial.
- WordPress Contact Form 7 & WP-Mail-SMTP problem solved
- imagecache wrong path – SOLVED!
- 7129/6105195 Edward Leedskalnin’s anti-gravity – How he built Coral Castle.
- How to take Ownership of a Drive, Folder or File in Windows 7
- WordPress widgets not saving or dragging?
- Firefox – update favicon.ico (SOLVED)
- IE emulator for FireFox
- Site off-line The site is currently not available due to technical problems. Please try again later. Thank you for your understanding. (SOLVED!)
- Access denied – Drupal 6.x
Archives
- November 2011
- September 2011
- August 2011
- June 2011
- January 2011
- December 2010
- November 2010
- October 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- January 2009
- December 2008
- August 2008
- June 2008
