Forum Moderators: phranque

Message Too Old, No Replies

Redirect from subdomain to TLD

         

guillermo5000

7:16 am on Jun 7, 2003 (gmt 0)

10+ Year Member



Hello,

We recently acquired a new domain name that points to a sub-domain on our server. We are redirecting users of the old sub-domain URL to the new domain name URL with the following rules in the htaccess of the sub-domain directory:

RewriteCond %{HTTP_HOST}!^www\.newdomainname\.com
RewriteRule ^(.*)$ [newdomainname.com...] [R=permanent,L]

It seems to work fine, but is it the most effective/best way to do this redirect? Thanks

Bill

jdMorgan

9:44 pm on Jun 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Bill,

Not quite sure what the question is... If you want to make the mod_rewrite a little more efficient, you can use "301" instead of "Permanent".


RewriteCond %{HTTP_HOST} !^www\.newdomainname\.com
RewriteRule ^(.*)$ http://www.newdomainname.com/$1 [R=301,L]

At a higher level, it would be better to point the recently-acquired domain directly to your main domain at the DNS level, avoiding the need to redirect entirely.

Jim

guillermo5000

2:14 am on Jun 8, 2003 (gmt 0)

10+ Year Member



We bought a new domain name for a website that currently resides at a subdomain. I am simply giving them space on my server (theirname.myname.com).

So what I am trying to do is keep their site hosted on my server as a subdomain, I will point the new top level domain to the subdirectory that contains their website, and redirect visitors to the old subdomain (theirname.myname.com) to the new domain name (theirname.com)

Hope that clarifies what I'm trying to accomplish. Thanks for any advice.