Redirect on a Shared Account Hosting

Using a single web hosting account to host multiple sites

Redirect on a Shared Account Hosting

Postby flickernever » Sun Apr 05, 2009 4:15 pm

Greetings,

The situation is the follow:

I have this root domain:
Code: Select all
www.domain.org

It is associated with the hosting account. Every single domain I add to the account is added as an addon, appearing both as
Code: Select all
www.other.domain.org
and
Code: Select all
www.other.com
I need to redirect all and ONLY the pages of this:
Code: Select all
www.domain.org
to
Code: Select all
www.domain2.net
If I use a simple redirect, all of the pages of ALL the subdomains get redirected as well and I don't want that. I want to redirect all pages like
Code: Select all
www.domain.org/index.html
or
Code: Select all
domain.org/something.html
to
Code: Select all
domain.net


Again, using a simple redirect, pages like www.other.domain.org/index.html are redirected too and that is not what I want.

Until now this code manages to redirect ONLY the main www.domain.org to www.domain.net. How can I redirect all of the pages permantly?

Code: Select all
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?domain.org$
RewriteRule ^(/)?$ http://domain2.net [L]


Any help, please?

Thanks for reading.
flickernever
 
Posts: 5
Joined: Sun Apr 05, 2009 3:51 pm

Postby richardk » Mon Apr 06, 2009 2:20 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?example\.org$ [NC]
RewriteRule ^(.*)$ http://example.net/$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby flickernever » Mon Apr 06, 2009 7:34 pm

Hello richardk and thank you for your response. :)

What that does is redirect the:
Code: Select all
example.org/page.html
to
Code: Select all
example.net/page.html


How can I redirect it to only example.net, the domain only?
flickernever
 
Posts: 5
Joined: Sun Apr 05, 2009 3:51 pm

Postby richardk » Tue Apr 07, 2009 6:49 am

Replace
Code: Select all
/$1

with
Code: Select all
/?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby flickernever » Wed Apr 08, 2009 6:06 pm

Thank you Richard, problem solved.
flickernever
 
Posts: 5
Joined: Sun Apr 05, 2009 3:51 pm


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 13 guests

cron