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

how to redirect all outgoing links to a single domain

Discussion in 'Black Hat SEO' started by Eagle Eye, May 9, 2012.

  1. Eagle Eye

    Eagle Eye Senior Member

    Joined:
    Aug 3, 2010
    Messages:
    1,063
    Likes Received:
    612
    Gender:
    Male
    Occupation:
    Achiever
    Location:
    East Coast
    This is probably very easy and I have some ideas on how to do this but I wanted to get some feedback from the great people at BHW. What I want to do is redirect all outgoing links on domain #1 so that they land on domain #2. Any suggestions from anyone? Any help would be much appreciated!
     
  2. Eagle Eye

    Eagle Eye Senior Member

    Joined:
    Aug 3, 2010
    Messages:
    1,063
    Likes Received:
    612
    Gender:
    Male
    Occupation:
    Achiever
    Location:
    East Coast
    anyone?
     
  3. ija61

    ija61 Senior Member

    Joined:
    Mar 2, 2011
    Messages:
    965
    Likes Received:
    635
    Gender:
    Male
    Occupation:
    The first SEO economist:)
    Location:
    Romania
    I'm not sure I understand what you need. Can you please give us more details?
     
  4. siteking

    siteking Junior Member

    Joined:
    Sep 16, 2011
    Messages:
    119
    Likes Received:
    10
    This is a simple htaccess job
     
  5. Eagle Eye

    Eagle Eye Senior Member

    Joined:
    Aug 3, 2010
    Messages:
    1,063
    Likes Received:
    612
    Gender:
    Male
    Occupation:
    Achiever
    Location:
    East Coast
    That is what I figured but if you have time could you give me some suggestion as to how to do it?
     
  6. Eagle Eye

    Eagle Eye Senior Member

    Joined:
    Aug 3, 2010
    Messages:
    1,063
    Likes Received:
    612
    Gender:
    Male
    Occupation:
    Achiever
    Location:
    East Coast
    Ok I have a bunch of links pointing to other domains etc... What I want to do is point all the outgoing links to a single domain.

    All outgoing links on domain #1 will point to domain #2. I hope that makes sense
     
  7. Eagle Eye

    Eagle Eye Senior Member

    Joined:
    Aug 3, 2010
    Messages:
    1,063
    Likes Received:
    612
    Gender:
    Male
    Occupation:
    Achiever
    Location:
    East Coast
    bump...
     
  8. ija61

    ija61 Senior Member

    Joined:
    Mar 2, 2011
    Messages:
    965
    Likes Received:
    635
    Gender:
    Male
    Occupation:
    The first SEO economist:)
    Location:
    Romania
    hmmm not sure what the code line are but I will make my searches and hope to come back with an response since this look interesting and something nice to study

    The idea is that you should write a rule that redirect all the links to your second domain and add an exception to this rule so the rule will not take effect if your first domain (HTTP_HOST) is in the url.
     
    Last edited: May 9, 2012
  9. Eagle Eye

    Eagle Eye Senior Member

    Joined:
    Aug 3, 2010
    Messages:
    1,063
    Likes Received:
    612
    Gender:
    Male
    Occupation:
    Achiever
    Location:
    East Coast
    Thanks man I really appreciate any help you could provide
     
  10. siteking

    siteking Junior Member

    Joined:
    Sep 16, 2011
    Messages:
    119
    Likes Received:
    10
    • Thanks Thanks x 1
  11. Eagle Eye

    Eagle Eye Senior Member

    Joined:
    Aug 3, 2010
    Messages:
    1,063
    Likes Received:
    612
    Gender:
    Male
    Occupation:
    Achiever
    Location:
    East Coast
    Thanks man I really appreciate the help

     
  12. ija61

    ija61 Senior Member

    Joined:
    Mar 2, 2011
    Messages:
    965
    Likes Received:
    635
    Gender:
    Male
    Occupation:
    The first SEO economist:)
    Location:
    Romania
    Not sure this will work, for what I know this will redirect all the links from what I understand is that he want to redirect only the outgoing links, and I suppose he will not know all what those will be.
     
  13. Eagle Eye

    Eagle Eye Senior Member

    Joined:
    Aug 3, 2010
    Messages:
    1,063
    Likes Received:
    612
    Gender:
    Male
    Occupation:
    Achiever
    Location:
    East Coast
    yes I want to redirect only the outgoing links
     
  14. thejake

    thejake Power Member

    Joined:
    Nov 13, 2009
    Messages:
    685
    Likes Received:
    829
    Why not jquery?

    Code:
    $('a').each(function(x) {$(this).attr('href',this.href.replace('olddomain','newdomain'));})
    
     
  15. Eagle Eye

    Eagle Eye Senior Member

    Joined:
    Aug 3, 2010
    Messages:
    1,063
    Likes Received:
    612
    Gender:
    Male
    Occupation:
    Achiever
    Location:
    East Coast
    where would I put this though? In htaccess file?
     
  16. thejake

    thejake Power Member

    Joined:
    Nov 13, 2009
    Messages:
    685
    Likes Received:
    829
    If you really need to do it in your htaccess file you use mod_substitute

    Code:
    AddOutputFilterByType SUBSTITUTE text/html
    Substitute s/olddomain/newdomain/niq
    
     
  17. ija61

    ija61 Senior Member

    Joined:
    Mar 2, 2011
    Messages:
    965
    Likes Received:
    635
    Gender:
    Male
    Occupation:
    The first SEO economist:)
    Location:
    Romania
    Hy.

    I may found somethign but not test it yet, since I'm up for about almost 24 h now I do not have the time to test it right now but you can give it a try.

    HTML:
    RewriteEngine On
    
    RewriteCond %{REQUEST_URI} !^http://www.domain1.com
    RewriteRule ^(.*)$ http://www.domain2.com [R=301,L]
    
    
    If not working this si what you should search for and the problem may come from the regular expression.
     
  18. -Jericho-

    -Jericho- Jr. Executive VIP

    Joined:
    Jan 10, 2010
    Messages:
    2,850
    Likes Received:
    1,708
    Location:
    Stalking My Ex-Wife
    You can play with this JS code to try and do what you want: http://snipplr.com/view/28917/

    I'm not sure I understand exactly what you are trying to do. Are all the outgoing links similar or are they for multiple different domains?
     
    Last edited: May 9, 2012
  19. Eagle Eye

    Eagle Eye Senior Member

    Joined:
    Aug 3, 2010
    Messages:
    1,063
    Likes Received:
    612
    Gender:
    Male
    Occupation:
    Achiever
    Location:
    East Coast
    so the file would look like this?

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    AddOutputFilterByType SUBSTITUTE text/html
    Substitute s/http://www.olddomain.info/http://www.newdomain.info/niq
    </IfModule>

    # END WordPress
    [/code][/QUOTE]



     
  20. Eagle Eye

    Eagle Eye Senior Member

    Joined:
    Aug 3, 2010
    Messages:
    1,063
    Likes Received:
    612
    Gender:
    Male
    Occupation:
    Achiever
    Location:
    East Coast
    no all outbound links are similar. I am just trying to redirect customers to another site before purchasing a product. Basically I want to mass edit all out bound links so that they point to the same domain

    I looked at that code but I have no idea where to put it on the server. any suggestions?