This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Redirect to New Domain
Message |

Joined: 27 April 2010
Posts: 3
Posted: 16 February 2012 at 5:35pm

Given all the help on this site, I thought this would be easy. I've tried various
combinations of rules, all resulting in errors. Obviously, I'm doing something wrong. Any
help would be greatly appreciated.

I have an existing site with a few rewrite rules in place. We need to redirect all
traffic to a new domain.

Old Domain:
New Domain:

I've tried the "Moving site location" rule from the Examples page, but it conflicts with
one of the other rules and Firefox delivers the infinite loop error.

#Permanent redirect to update old links
RewriteRule (.+)$1 [R=301,L]

The following works as long as I don't try to browse to any specific page, like

RewriteCond %{HTTP:Host} ^www\.csearetirees\.org$
RewriteRule (.*)$1 [R=301,L]

If I add the RewriteBase directive, then the individual page redirections below don't

Here's the complete file as it exists right now.

# Helicon ISAPI_Rewrite configuration file
# Version

RewriteEngine on

# redirect to www
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]

# global rewrite to new domain
# error: browsing to sub-page redirects to
# RewriteCond %{HTTP:Host} ^www\.csearetirees\.org$
# RewriteRule (.*)$1 [R=301,L]

#individual rewrites to pages
RewriteRule ^legislation$ Legislation.aspx [NC, R=301, L]
RewriteRule ^about$ AboutUs.aspx [NC, R=301, L]
RewriteRule ^chapters$ Chapters.aspx [NC, R=301, L]
RewriteRule ^questions$ Questions.aspx [NC, R=301, L]
RewriteRule ^join$ Join.aspx [NC, R=301, L]
RewriteRule ^contact$ ContactUs.aspx [NC, R=301, L]
Back to Top

Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 20 February 2012 at 3:57am


Seems like all you need is to replace
RewriteCond %{HTTP:Host} ^www\.csearetirees\.org$
RewriteRule (.*)$1 [R=301,L]


RewriteCond %{HTTP:Host} ^www\.csearetirees\.org$
RewriteRule (.*)$1 [NC,R=301,L]

Back to Top

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version