.htaccess rewrite affiliate link

Discussion in 'Site & Server Administration' started by Bass Turd, Nov 29, 2010.

  1. #1
    I would like to rewrite http://www.afilliatesite.com/file.php?lc=###########&url=http://www.affiliate.com/product/blah

    I would like to mask the http://www.afilliatesite.com/file.php?lc=###########&url= part to be www.mydomain.com/goto?http://affiliate.com/product/blah (or similar)

    Thanks.
     
    Bass Turd, Nov 29, 2010 IP
  2. Bass Turd

    Bass Turd Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #2
    Hoping somebody can help me out.

    Thanks.
     
    Bass Turd, Dec 5, 2010 IP
  3. SeedingTorrents

    SeedingTorrents Active Member

    Messages:
    193
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    if you are using wordpress try wp redirection plugin!
     
    SeedingTorrents, Dec 6, 2010 IP
  4. Nahid

    Nahid Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Please make it clear.

    first write which link will the site user see and next write the actual link of your site
     
    Nahid, Dec 6, 2010 IP
  5. Bass Turd

    Bass Turd Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #5
    Bass Turd, Dec 10, 2010 IP
  6. Bass Turd

    Bass Turd Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #6
    Can anybody help out?
     
    Bass Turd, Dec 17, 2010 IP
  7. owsolution

    owsolution Well-Known Member

    Messages:
    290
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    138
    #7
    Very easy, do it with php. Uses less resources than mod_rewrite (aka .htaccess). I use a little more complex way in the sites listed in my signature that redirects every site url's from a database; but for you, the below should work fine.

    Make a file called goto.php and put the below code in it and upload to your site.

    <?php
    $out = $_GET['out'];
    header("Location: $out");
    ?>

    Then call the PHP file from your domain like so. ( The Below Link Examples Work If You Want To See )

    http://proxyfreak.org/goto.php?out=http://google.com
    http://proxyfreak.org/goto.php?out=http://yahoo.com
    http://proxyfreak.org/goto.php?out=http://bing.com

    Replace my site with yours and replace the search engine examples above with the urls you want to redirect from your site too.
     
    Last edited: Dec 20, 2010
    owsolution, Dec 20, 2010 IP
  8. Bass Turd

    Bass Turd Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #8
    Thank you, that's a step in the right direction. I will use this method for now, but do you know of a way to actually hide the affiliate link all together?
     
    Bass Turd, Dec 21, 2010 IP
  9. animebuzz.tv

    animebuzz.tv Peon

    Messages:
    317
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    if you want to hide the affiliate link why not use short url like this one http://bit.ly/ ??
     
    animebuzz.tv, Dec 21, 2010 IP
  10. Bass Turd

    Bass Turd Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #10
    Bass Turd, Dec 21, 2010 IP