· Chris Hammond
Last Updated
Setting up IIRF to redirect to www
Learn how to easily manage URL redirects using IIRF to ensure proper HTTPS and www prefix on your website with this simple rule. #webdevelopment #URLredirects
So I have been doing some testing on my website and needed to redirect requests to https://www.chrishammond.com to https://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 ^/(.*) https://www.chrishammond.com/$1 [I,RP]