1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to redirect to subdomain

Discussion in 'Search Engine Optimization (SEO)' started by solvberg, Dec 16, 2009.

  1. solvberg

    solvberg New Member

    Joined:
    Dec 16, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hello there!

    I do have a domain, where the main domain is now empty,

    I do have a sub domain, where I do have my blog.

    I would like to redirect people who land on my main domain to the subdomain. The people who are redirected do not need to know they are redirected, so the url could still show the main domain. And also, is possible to make such redirection SEO friendly?

    I understand this can be done with a .htaccess file, but I need help to make that file.

    Later I may be make a bigger web site at the main domain, and the blog will continue, but then as a part of the bigger site, but that is later.

    Is there anyone who can help me make a .htaccess file?

    Best regards, Jan
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    No Such a redirect would not be SEO friendly because you will have 2 urls for same content but instead of redirect without having url not change try redirect with URL change as that will be SEO friendly
     
  3. solvberg

    solvberg New Member

    Joined:
    Dec 16, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Thank you for quick response Shabbir.

    The problem as a novice I need help for what to put into that .htaccess file. What commands and so on.

    I hope you can help me with this.

    Best regards, Jan
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    First do you want to redirect to you want to show on both the domains.

    Let me know and I will share what you should put in .htaccess
     
  5. solvberg

    solvberg New Member

    Joined:
    Dec 16, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Thank you Shabbir for quick response again.

    I would like to redirect people automatic to the blog domain. If they can see that they are redirected or not, is not important. Just to move them to the subdomain and open the wordpress blog I have there. But also to keep it SEO friendly.

    The thought is to keep the main domain empty at the moment, to be able to use it in the future.

    If there is no simple way to do this I will rather move my blog to the main domain.

    I hope you can help me and that you now have enough information about it.

    Best regards, Jan
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    Use the following

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

Share This Page