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
Author
Message |
saunan
Newbie


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: www.csearetirees.org
New Domain: www.californiastateretirees.org

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 (.+) http://www.californiastateretirees.org$1 [R=301,L]

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

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

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

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

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.87

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 www.csearetirees.org/default.aspx redirects to
www.californiastateretirees.orgdefault.aspx
# RewriteCond %{HTTP:Host} ^www\.csearetirees\.org$
# RewriteRule (.*) http://www.californiastateretirees.org$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
 
Guests
Guest


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

Hello,

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

with

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


Regards
Andrew
Back to Top
 

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

Printable version Printable version