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 specific domain to a page
Author
Message |
janmontano
Newbie


Joined: 12 September 2011
Location: Australia
Posts: 15
Posted: 26 September 2011 at 12:25am

I have an IIS website with bindings:
www.main.com
www.aaa.com
www.bbb.com
www.ccc.com

I want www.aaa.com to redirect to www.main.com/site1
I want www.bbb.com to redirect to www.main.com/site2
I want www.ccc.com to redirect to www.main.com/site3

How would I do this with ISAPI Rewrite 3.0?

Cheers,
Jan

__________________
http://www.kokoness.com.au
Back to Top Visit janmontano's Homepage
 
janmontano
Newbie


Joined: 12 September 2011
Location: Australia
Posts: 15
Posted: 26 September 2011 at 1:34am

I think I have it sorted by using this format:

RewriteCond %{HTTP_HOST} ^vitapet\.co\.nz$ [NC]
RewriteRule (.*) http://www.masterpet.com/Vitapet
[R=301,L]

RewriteCond %{HTTP_HOST} ^www\.vitapet\.co\.nz$ [NC]
RewriteRule (.*) http://www.masterpet.com/Vitapet
[R=301,L]

If I have another site which I need to redirect to the
vitapet page, I could just create another set.

But is there a way to use an OR (|) operator in this
instance? So I'll just have a single ReWriteCond (with
multiple conditions) and a single reWriteRule.

__________________
http://www.kokoness.com.au
Back to Top Visit janmontano's Homepage
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 26 September 2011 at 9:57am

Try using:

RewriteCond %{HTTP_HOST} ^(?:vitapet\.co\.nz|www\.vitapet\.co\.nz)$ [NC]

Regards
Andrew
Back to Top
 
janmontano
Newbie


Joined: 12 September 2011
Location: Australia
Posts: 15
Posted: 26 September 2011 at 5:35pm

Perfect! Thanks.

__________________
http://www.kokoness.com.au
Back to Top Visit janmontano's Homepage
 

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

Printable version Printable version