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

Discussion in 'Search Engine Optimization (SEO)' started by here's jonny, Mar 27, 2007.

  1. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Moved your thread from Web Hosting to SEO forum.
    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
    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.
    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
     
  3. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    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 ! ??
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    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.
     
  5. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    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 ??
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    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
     
  7. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    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 ??
     
  8. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Nope. In the root of the main domain.
     
  9. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    Thanks again.. :)
    I'm going to try this on one of my addon domains, which shares the same folder as my subdomain.
     
  10. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    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 ?
     
  11. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Are you trying on the subdomain of some free domain providers then it should go into the subdomain only.
     
  12. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    When I set my site up originally, I created a sub domain and ran it from there.
    It seemed to make sense at the time.

    Then I bought a new domain (domain.co.uk) and pointed it to the same files as the sub domain.

    I finally bought another domain (domain.com) which reflects exactly what the site is, so I want to use that !!

    So I'm looking to redirect the domain.co.uk to domain.com.

    As domain.co.uk's files are in the subdomains folder, I assume that is where I need to locate the .htaccess ??

    Thanks
     
  13. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    As far as I know there should be one .htaccess file in the parent folder but if its working for you in sub-domain I don't see any problem here.
     
  14. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    Hi

    I've tested using this :

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(test\.)?old-domain\.co\.uk$ [NC]
    RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L]

    and it seems to work OK locating the .htaccess in the subdomains directory:

    This OK for the subdomain, but now I need to consider the second domain.
    Currently users access the site via:

    www.2ndDomain.co.uk
    2ndDomain.co.uk
    www.2ndDomain.co.uk/forum
    2ndDomain.co.uk/forum

    How do I redirect that to the new-domain.com ? ?

    Finally - I have the main domain name....
    Users can access via:

    sub.maindomain.co.uk
    www.maindomain.co.uk
    maindomain.co.uk
    www.maindomain.co.uk/sub
    maindomain.co.uk/sub

    How do I redirect that to the new-domain.com ? ?

    My aim is to get everything going to the new-domain.com... :confused:

    Many Thanks
     
  15. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    For both the redirects your above redirect with slight mod will work.

    Just go through the following question at the [thread=145]SEO FAQ[/thread] thread.
    It will redirect to non www version to the www one and then you can always add the redirect to the new domain.
     
  16. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    Shabbir - Thanks :)

    I'm sure I'll be back shortly with some more questions !!
     
  17. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    :) I'm back.

    I need to redirect domain.co.uk & www.domain.co.uk -> www.domain.com

    Is this correct ?? :

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain\.co\.uk$ [NC]
    RewriteCond %{HTTP_HOST} ^www.domain\.co\.uk$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
    Then I need to make sure domain.com -> www.domain.com

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
    What am I missing ??
     
  18. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    I would redirect everything from domain.co.uk to www version of the new domain and not have a redirect to the www version of domain.co.uk
     
  19. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    I thought that's what the examples above did !!
    Is that not correct ?
     
  20. here's jonny

    here's jonny New Member

    Joined:
    Mar 27, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    One thing I've just noticed !!

    I'm using:
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(test\.)?xxxx\.co\.uk$ [NC] 
    RewriteRule ^(.*)$ http://test.aaaaa.com/$1 [R=301,L]
    This redirects a subdomain of xxxx.co.uk to the new address and works well.

    Except people could still visit by www.xxxx.co.uk/test or xxxx.co.uk/test
    How do I stop that as well ???

    Once I've got this bit and confirmed the other redirects,I'm sorted :)

    Thanks
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice