Posts Tagged ‘free url rewriter’
IIRF WordPress – URL Rewriting for IIS6.0
Last Updated on Tuesday, 17 November 2009 12:03 Written by Simon Nicol Tuesday, 6 October 2009 11:36
Firstly – appologies to everyone who visited this blog over the last couple of days because my URL Rewriting was all wonky. Now it’s working again thank God (and a few handy websites) and back to normal. Thanks for your patience.
If you need to find out how to install IIRF on Windows have a look at this post first. It’s a complete walk-through from start to finish that will get IIRF up and running on IIS6 in no time at all. (This post is now pretty much redundant as the walk-through goes in to far more detail for both WordPress and Drupal installations than this post does.
This post is about how to get IIRF working on IIS6 running the fabulous WordPress.
Obviously you will need to change the domain name from CaspianIT to your own domain. I found parts of this code on a blog posting by John Sheehan, thank’s John! I did find that the code on John’s blog didn’t quite work for me, but there was some code on one of the comments on other blogs that when combined worked perfectly. You can read John’s blog posting here.
*Update*
I thought I would come back to show you the latest modifications to my IsapiRewrite4.ini file, this is the script that is running right now to deliver this very page you are reading right now – this is what it does and I think it will probably be suitable for majority of bloggers needs – thus the update.
RewriteCond %{HTTP_HOST} ^(caspianit\.co\.uk).*$ [I]
RedirectRule ^/(.*)$ http://www.caspianit.co.uk/$1 [I,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)$ /index.php/$1 [L]
The above script will change any page from an http://caspianit.co.uk request to a http://www.caspianit.co.uk
The reason I decided to go with the addition of the www instead of without is because the administration pages won’t work without the www! Yes I could put further conditions that would check for the ‘wp-admin’ and then not to rewrite the URL, but rather than complicate things further it’s easier just to go with the ‘www’ bit. Another reason is because if you’re using the XMLSiteMap plugin, it will write all our URL’s with www. attached to the URL.
One the second line the [I,R=301] does this: The I (must be a capital ‘I’) tells IIRF to no be case sensitive (which is quite ironic having to be a capital I – lol) and the R=301 tells the search engines that this is a permanent Redirect (301) to this URL. Using the R=301 will help your rankings in the search engines because Google et all will quite happily crawl both the http://www.yourdomain.com/yourpage AND http://yourdomain.com/yourpage and treat them as two completely separate pages – and then mark you down for having duplicate content – doh!
For the vast majority of you who don’t have a .co.uk domain name (or at least is you have a .com or similar) change the first line to the following:
RewriteCond %{HTTP_HOST} ^(yourdomainname\.com).*$ [I]
And that should do it. Obviously there are many different configurations but the script above should suit most WordPress installations. I think IIRF is great, it’s not only FREE it’s also powerful and it doesn’t have ridiculous licensing constraints on it. It may take a tiny bit of effort to set up but really it’s not a lot more than other ISAPI Re-writers and it doesn’t cost $99!
I hope this works for you.
Simon
Tags: .htaccess, free url rewriter, IIRF, ISAPI Rewrite, mod_rewrite, wordpress | Posted under Articles & Reviews, Tutorials | No Comments
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