How to redirect traffin from backlinks

Discussion in 'SEO, Traffic and Revenue' started by Brandon, Feb 1, 2013.

  1. Brandon

    Brandon Regular Member

    Joined:
    Jun 1, 2009
    Messages:
    6,602
    Likes Received:
    1,706
    Location:
    Topeka, Kansas
    First Name:
    Brandon
    I would like to redirect some links that point to my blog and have them point to this forum but I want my blog to be up still.

    For example I have several backlinks from examplesite.com and I'd like to redirect the link to this forum, but I don't want to just do a blanket redirect for all links, and I want my blog to remain up still.

    Is that possible?

    Thanks

    Maybe something like this?


    Code:
    Redirect 301 http://examplesite.com http://www.newsite.com
    but I'd want to redirect all links on examplesite.com
    so examplesite.com/1
    examplesite.com/2
    examplesite.com/3.html

    etc.. all to the new site
     
  2. SimplySidy

    SimplySidy Website Consultant, Developer and Strategist

    Joined:
    Dec 9, 2012
    Messages:
    87
    Likes Received:
    9
    Location:
    Bhubaneswar, India
    Not sure, but yes, I think you can try out some of the conditional statements on the .htaccess file of your website.
     
  3. bigbigfan

    bigbigfan Regular Member

    Joined:
    Jan 18, 2013
    Messages:
    61
    Likes Received:
    22
    Yes, this can be done, but you need to understand what is going on so that you don't break it later on by accident.

    Firstly you will need to know the URL from which the visitor came, this information is stored in the query string, but the problem with relying on the query string to redirect people is that it is sometimes blank, browser security and such may delete it if in private mode etc so you need to account for that first with this to make sure it's not blank.


    Code:
    RewriteCond %{QUERY_STRING} !.
     
    

    The next step, now that you know the query string isn't blank is to add another condition so that you only redirect people coming from one specific url.
    Code:
    RewriteCond %{HTTP_REFERER} (www\.)?example\.com/some-other-page [NC]
    Now that you've identified the visitor as coming from the other page you need to redirect them
    Code:
    RewriteRule ^current-page$ http://www.yoursite.com/new-page.html [R=301,L] 
    Those three steps will redirect a majority of the visitors coming from the other site to the new page but it's not foolproof, it requires the query string, so not everyone will get redirected.

    Considerations: Googlebot does not provide a query string, it visits pages directly, so this will not stop Googlebot from indexing the page you are sending people away from and it will not stop a cache version from appearing in Google results.

    Also, the above three lines of code need to be placed BEFORE any wordpress code in your htaccess, above other redirects. Good luck.
     
    Brandon likes this.
  4. Brandon

    Brandon Regular Member

    Joined:
    Jun 1, 2009
    Messages:
    6,602
    Likes Received:
    1,706
    Location:
    Topeka, Kansas
    First Name:
    Brandon
    Thank you so much @bigbigfan
    I'll play around with these tonight to see if I can get them working. :thumbsup:
     

Share This Page