.htaccess redirect

Discussion in 'Black Hat SEO' started by billyh7, Sep 17, 2010.

  1. billyh7

    billyh7 Junior Member

    Joined:
    Dec 18, 2008
    Messages:
    162
    Likes Received:
    2
    Does anybody have a script I can use to do a .htaccess redirect on a wordpress site so I can forward users to my affiliate page?
     
  2. Satan Claus

    Satan Claus Regular Member Premium Member

    Joined:
    Aug 25, 2010
    Messages:
    217
    Likes Received:
    193
    Not sure what good a "script" would do...

    Code:
    htaccess:
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^whatever(.*)$ h t t p : / / www . example . com / [R=301,L]
    
    perl cgi :
    
    #!/usr/bin/perl
    
    print "Status: 301 Moved Permanently\r\nLocation: someurl\r\n\r\n";
    
    PHP:
    
    <?php echo "Status: 301 Moved Permanently\r\nLocation: someurl\r\n\r\n"; ?>
    
     
  3. mikie46

    mikie46 Jr. VIP Jr. VIP

    Joined:
    Aug 6, 2008
    Messages:
    1,454
    Likes Received:
    1,103
    Script? You dont need a script just put this in your .htaccess file then test

    Code:
    #
    Redirect 302 /product http://affiliate_url
    
    If your link is http://yourdomain.com/product/ then it will forward to http://affiliate_url

    Simple.
     
  4. billyh7

    billyh7 Junior Member

    Joined:
    Dec 18, 2008
    Messages:
    162
    Likes Received:
    2
    will it work in PPC campaigns? Can Google see this and ban my account?