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 another domain
Author
Message |
gerryleblanc
Newbie


Joined: 25 October 2011
Posts: 5
Posted: 25 October 2011 at 1:17pm

Hello!

I have been searching for an answer to this:
How can I redirect http://www.domain.com/ to http://www.another.com/
without it being a blanket statement causing
http://www.domain.com/foo.html to also redirect to
http://www.another.com/

Thank you for any insight!
Gerry
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 26 October 2011 at 6:02am

Hello,

Please, see examples section under "Moving site location"

Regards
Andrew
Back to Top
 
gerryleblanc
Newbie


Joined: 25 October 2011
Posts: 5
Posted: 26 October 2011 at 9:40am

Andrew,

Thanks for your reply.

I tried that and I may have a unique issue.

I am hosted on IIS, and I have created a domain alias which, in effect, creates duplicate
content. (http://www.domain1.com/page.html is the same content at
http://www.domain2.com/page.html)

I'd like ISAPI rewrite to "do away" with domain1 and convert all URLs to domain2.

When I implement the code:
------
RewriteEngine on

#Permanent redirect to update old links
RewriteRule (.+) http://domain2.com$1 [R=301,L]
--------

I get too many redirects because the (.+) seems to apply to all requests regardless of
the domain in the address bar. I only want to do the 301s if the domain in the
address bar is domain1, and ignore any rewrite if domain2 is in the address bar.

Thanks for any thoughts you may have!
Gerry

Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 27 October 2011 at 4:26am

hello,

try using this rule in the .htaccess of domain1 site.

Regards
Andrew
Back to Top
 
gerryleblanc
Newbie


Joined: 25 October 2011
Posts: 5
Posted: 27 October 2011 at 8:58am

Andrew,

A bit more clarification... the two domains are hosted together and aliased to
each other.

My .htaccess file loads regardless of the domain, hence my desire to take
action only when domain1.com is in the URL bar.
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 02 November 2011 at 6:27am

We assume that it's better to place a rule to httpd.conf to make it work.

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