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

Redirect only for home page

Discussion in 'Black Hat SEO' started by emilix123, Feb 24, 2013.

  1. emilix123

    emilix123 Junior Member

    Joined:
    Apr 14, 2010
    Messages:
    161
    Likes Received:
    2
    Hi guys I have a site on wordpress...

    I need to create a .htaccess file to do a 301 redirect ONLY of my homepage, all other pages I have must remain active in the old site:

    homepage.com >>>>> newsite.com
    homepage.com/page1 >>>>> homepage.com/page1
    homepage.com/page2 >>>>> homepage.com/page2

    what code should I use?



    thanks
     
  2. mrblackjack

    mrblackjack Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 6, 2011
    Messages:
    960
    Likes Received:
    552
    Occupation:
    I live alone, I work alone, I make money alone
    Location:
    G00gle LaNd
    Hey buddy,
    this will do the trick:
    Code:
    RewriteEngine on
    RewriteRule ^$ http://www.newsite.com [R=301,L]
    
    P.S.
    replace: 'newsite.com' with your newer site to redirect to
    good luck :)
     
  3. emilix123

    emilix123 Junior Member

    Joined:
    Apr 14, 2010
    Messages:
    161
    Likes Received:
    2
    Code:
    RewriteEngine on
    RewriteRule ^$ http://www.newsite.com [R=301,L]
    
    with this code the other pages on the site are inactive!:

    homepage.com >>>>> newsite.com
    homepage.com/page1 >>>>> NOT FOUND!
     
  4. mrblackjack

    mrblackjack Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 6, 2011
    Messages:
    960
    Likes Received:
    552
    Occupation:
    I live alone, I work alone, I make money alone
    Location:
    G00gle LaNd
    Are u sure?
    it works fine for me.
    here take a look:
    domain: search-walla.tk -> esek2all.co.il
    internal page: search-walla.tk/money/ -> search-walla.tk/money/

    it works fine...
     
  5. emilix123

    emilix123 Junior Member

    Joined:
    Apr 14, 2010
    Messages:
    161
    Likes Received:
    2
    I'm sorry I'm just stupid! was wrong folder!
     
    Last edited: Feb 24, 2013
  6. Schvamp

    Schvamp Power Member

    Joined:
    Feb 13, 2012
    Messages:
    684
    Likes Received:
    549
    Location:
    Hogwarts
    Or you could just paste this in your header.php

    Code:
    <?php if(is_home()){ echo '<meta http-equiv="refresh" content="0;URL=HTTP://YOURSITE.com">' ; } ?>