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

here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
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
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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
0
here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
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 ! ??
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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.
0
here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
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 ??
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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
0
here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
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 ??
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Nope. In the root of the main domain.
0
here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
Thanks again..
I'm going to try this on one of my addon domains, which shares the same folder as my subdomain.
0
here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
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 ?