Setting up IIRF to redirect to www

By: Chris Hammond
Published Date 2/18/2008
Last Updated Monday, February 18, 2008 4:01 PM

So I have been doing some testing on my website and needed to redirect requests to http://chrishammond.com to http://www.chrishammond.com/. Lucky for me the site is using IIRF to manage my urls from the old community server days to my DotNetNuke conversion.

Using IIRF I'm able to create a simple rule that will handle the redirects for me, I've pasted it below.

# force proper www. prefix on all requests
RewriteCond %{HTTP_HOST} ^chrishammond\.com [I]
RewriteRule ^/(.*) http://www.chrishammond.com/$1 [I,RP]

Recent Comments

[RP] - ? it's not in the official documentation Where did you get it from ?

Posted By: Furmek F on Thursday, March 06, 2008 8:01 AM
RP doesn't have any meaning to IIRF. I think it means "redirect permanently" on Helicon's ISAPI rewrite. If you want that in IIRF, just use [R] or combine it with [I] like [I,R].
Posted By: Cheeso C on Saturday, June 14, 2008 9:07 PM
Hi Chris, I've tried your suggestions above but no joy (I added the changes from the comment above this but still couldn't get it to work) Not sure quite what I'm doing wrong... any ideas? Thanks Simon RewriteCond %{HTTP_HOST} ^mydomain\.co.uk [I] RewriteRule ^/(.*) http://www.mydomain.co.uk/$1 [I,R]
Posted By: Simon Nicol on Wednesday, October 21, 2009 10:17 PM
I'm not actually using IIRF anymore, I use the URLMaster module for DotNetNuke, available from http://www.ifinity.com.au/
Posted By: Chris Hammond on Wednesday, October 21, 2009 11:40 PM
I just figured it out. The rule used is a RewriteRule. To redirect, use RedirectRule instead. RedirectRule ^/(.*) http://www.domaincom/$1 [R=301]
Posted By: Sujay R on Monday, November 09, 2009 5:34 PM

Add Comment

Please add your comment by filling out the field(s) below. Your comment may need to be approved before it becomes visible.
Enter your first name for display with the comment
Enter your last name for display with the comment.
Enter your email address so that we may contact you if necessary. We will also use this for your Gravatar.
Enter the URL to your website. URLs may be removed from comments.
Enter your comment here.
If you can't type Human in, you can't post, plain and simple.
Submit Comment Cancel

Chris Hammond is

Chris Hammond is a father, husband, developer, geek and car guy. Specializing in ASP.NET and DotNetNuke, you will find a variety of topics here on the website. For more information check out the about me page.

If you are looking for DotNetNuke consulting please visit my business website at http://www.christoc.com/ 

Disclaimer

Any blog posts here are solely the opinion and views of Chris Hammond only. Comments on blog posts are the opinion of the commenter, and not Chris Hammond.

Powered By

This website is managed by Christoc.com Software Solutions

DotNetNuke Hosting

Hosting for this website is provided by AppliedI.Net. Be sure to visit them for all your DotNetNuke Hosting needs. 

Find Me