Addon, Sub Domains and 301 redirect... HELP !

Go4Expert Member
27Mar2007,23:34   #1
here's jonny's Avatar
Hi
I have 3 domain names...

domain.co.uk (main domain)

* sub.domain.co.uk (sub)
* test.domain.co.uk (sub)

domain2.co.uk (addon)
domain.com (addon)

On domain.co.uk I have a subdomain 'sub.domain.co.uk'

This is located 'public_html/sub'

The 2 addon domains are both set to use the same path 'public_html/sub'

So regardless of which way you access the site, you hit the same files etc...

Ideally I only want users to visit via www.domain.com so would like to configure some for of permanent redirect.. I've been advised to do this using .htaccess and a 301 redirect.

To test this I would like to try it with domain2.co.uk and have all it's traffic redirected to www.domain.com

How do I do this as a test ??
How do I do it on the two .co.uk domain as a permanent redirect to the .com
Will this effect google ranks ?? as domain.co.uk has a good placement.

Hope this makes some for of sense..

Thanks
Go4Expert Founder
28Mar2007,08:03   #2
shabbir's Avatar
Moved your thread from Web Hosting to SEO forum.
Quote:
Originally Posted by here's jonny
How do I do this as a test ??
2 Ways of doing this.
1. Test it by typing the old domain and see if it redirects.
2. Check the server headers from any tool like http://www.seoconsultants.com/tools/headers.asp
Quote:
Originally Posted by here's jonny
How do I do it on the two .co.uk domain as a permanent redirect to the .com
Go through the Sticky thread right at the begining of this forum and your questions will get solved but then also I will help you with the quotes from that thread.
Quote:
Originally Posted by SEO FAQ's
I just changed my domain name. How can I switch without losing my rankings?

You'll need to do a 301 redirect from the old domain to the new domain. Fortunately this is not difficult to do. You'll need to add the following lines of code to a file called .htaccess and place it in the root directory of the old domain:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com$ [NC] 
RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L]
Quote:
Originally Posted by here's jonny
Will this effect google ranks ?? as domain.co.uk has a good placement.
If you have a permanent redirect the things will slowly move and it will be a smooth transfer and theoretically nothing should happen to the rankings but no one can predict the practical aspects of it. Again I would suggest you to go through SEO FAQ's
Go4Expert Member
29Mar2007,23:58   #3
here's jonny's Avatar
Thanks

What do I need to do, if I only want this to happen to 1 of the domains for now.. ??

Then when I ready make it affect all domains ! ??
Go4Expert Founder
30Mar2007,07:31   #4
shabbir's Avatar
Put the thing in the .htaccess file of the domain you wish to do as of now. When you plan to apply the same to the other domains do the same for them as well.
Go4Expert Member
31Mar2007,23:18   #5
here's jonny's Avatar
Thanks.. I'll try it and see what happens..

Last question for now

How do I add the subdomain and have the redirect to the new domain ??
Go4Expert Founder
1Apr2007,09:32   #6
shabbir's Avatar
Quote:
Originally Posted by here's jonny
Thanks.. I'll try it and see what happens..

Last question for now

How do I add the subdomain and have the redirect to the new domain ??
For creating a sub-domain you have to consult your hosting provider.

For redirecting you have to redirect use the same code I have given above with slight modification.
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(sub-domain\.)?old-domain\.com$ [NC] 
RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L]
See the only thing differs is from www to sub-domain
Go4Expert Member
1Apr2007,18:37   #7
here's jonny's Avatar
Thanks

I've already got the subdomain.. just wondered how to redirect from it !!

Does the .htaccess go in the root, or the subdomains root ??
Go4Expert Founder
1Apr2007,19:27   #8
shabbir's Avatar
Nope. In the root of the main domain.
Go4Expert Member
1Apr2007,19:38   #9
here's jonny's Avatar
Thanks again..
I'm going to try this on one of my addon domains, which shares the same folder as my subdomain.
Go4Expert Member
1Apr2007,19:49   #10
here's jonny's Avatar
Just tried this.. and found the following..

The domain I tried it on is an addon domain, it shares the same files as my sub domain.

They are located MyUser\public_html\ROOT\test
Test is the subdomains files...

If I add the .htaccess to root, I get:
www.newdomain.com/1$

If I add it to the sub domain directory it works..

Is this OK ?