Masking affiliate links - does this work?

Discussion in 'Affiliate Programs' started by kiplarson, Jul 2, 2007.

  1. #1
    I'm just looking for someone to review my code so I can verify my affiliate links will be recorded properly etc:

    Here is the code that I've placed in a file called vbseo.php in my /public_html/go/ directory

    <html>
    <head>
    <title>vBSEO</title>
    <meta name="robots" content="noindex,nofollow">
    <script>window.location="http://www.vbseo.com/615/";</script>
    <meta http-equiv="refresh" content="1; url=http://www.vbseo.com/615/">
    </head>
    <body>
    <p align="center">You are being taken to the correct page.
    <br>If the page does load after 5 seconds,
    <a href="http://www.vbseo.com/615/">click here</a>.</p>
    </body>
    </html>
    PHP:

     
    kiplarson, Jul 2, 2007 IP
  2. Jerlene.net

    Jerlene.net Prominent Member

    Messages:
    11,975
    Likes Received:
    463
    Best Answers:
    1
    Trophy Points:
    385
    #2
    Here’s the most quickest, painless method I’ve found yet to masking affiliate links without installing folders or script programs, etc.:

    Add this to your .htaccess file:

    Redirect 301 /folder http://www.domain.com/affiliatelinkgoeshere

    /folder can be whatever you like.

    Whenever you link to your affiliate product, use domain.com/folder and your visitors will be redirected to domain.com/affiliatelinkgoeshere. The visitor won’t see your affiliate link on your page at all, they’ll just see "domain.com/folder".
     
    Jerlene.net, Jul 3, 2007 IP
  3. uglyboy

    uglyboy Peon

    Messages:
    1,963
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is the script i use

    <php
    if ($m == "affiliatesite") {$link = "http://www.affiliatesite.net/ref.php?owner=123456";}
    if ($m == "another") {$link = "http://www.another.com/reg/affiliates.asp?AffiliateID=12345";}
    header("Location: $link"); // jump to hidden url
    exit();
    ?>
    PHP:
    Call this jump.php


    Link like so
    <a href="jump.php?m=affiliatesite">affiliatesite</a>
    <a href="jump.php?m=another">affiliatesite B</a>

    Works 4 me
     
    uglyboy, Jul 3, 2007 IP
  4. kiplarson

    kiplarson Peon

    Messages:
    449
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The code I posted is taken from John Chow's "how to mask affiliate links" blog post.

    Anyone else know for sure if the code I listed works though?
     
    kiplarson, Jul 3, 2007 IP
  5. AIBrian

    AIBrian Banned

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It should work....

    I think this part should mention javascript as the language:
    <script>window.location="http://www.vbseo.com/615/";</script>

    However, you have the meta refresh going on, so the javascript is probably not important.


    <meta http-equiv="refresh" content="1; url=http://www.vbseo.com/615/">

    The 1 signifies it will redirect to the url after 1 second.

    301 redirects are usually suggested over 302 redirects, ie. using the header("Location: http://mysite.com"), so if you're up for it I would suggest using Jerlene's method.
     
    AIBrian, Jul 3, 2007 IP
  6. kiplarson

    kiplarson Peon

    Messages:
    449
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I don't completely follow you on these steps, but I figure if the way I have works there is no reason for me to change it. I am perfectly fine with creating a .php document to place in a folder for each affiliate link I want to run.
     
    kiplarson, Jul 3, 2007 IP
  7. caj

    caj Active Member

    Messages:
    748
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    75
    #7
    Let say you have ten affiliate, what would be the link look like? Just wondering how?
     
    caj, Jul 4, 2007 IP
  8. uglyboy

    uglyboy Peon

    Messages:
    1,963
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #8
    <php
    if ($m == "affiliatesite1") {$link = "http://www.affiliatesite.net/ref.php?owner=123456";}
    if ($m == "affiliatesite2") {$link = "http://www.affiliatesite.com/ref.php?owner=123456";}
    if ($m == "affiliatesite3") {$link = "http://www.affiliatesite.co.uk/ref.php?owner=123456";}
    if ($m == "affiliatesite4") {$link = "http://www.affiliatesite.org/ref.php?owner=123456";}
    if ($m == "affiliatesite5") {$link = "http://www.affiliatesite.cc/ref.php?owner=123456";}
    header("Location: $link"); // jump to hidden url
    exit();
    ?>
    PHP:

    <a href="jump.php?m=affiliatesite1">affiliatesite1</a>
    <a href="jump.php?m=affiliatesite2">affiliatesite2</a>
    <a href="jump.php?m=affiliatesite3">affiliatesite3</a>
    <a href="jump.php?m=affiliatesite4">affiliatesite4</a>
    <a href="jump.php?m=affiliatesite5">affiliatesite5</a>


    It doesnt make a difference how many there are.. just follow the formula

    if ($m == "Name") {$link = "Affiliate link";}

    <a href="jump.php?m=Name">Link text</a>

    Does that help...
     
    uglyboy, Jul 4, 2007 IP
    Pammer likes this.
  9. Pammer

    Pammer Notable Member

    Messages:
    3,417
    Likes Received:
    397
    Best Answers:
    0
    Trophy Points:
    260
    #9
    niceone ugly boy, rep added :)
     
    Pammer, Jul 4, 2007 IP
  10. kiplarson

    kiplarson Peon

    Messages:
    449
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #10
    So lol, has anyone found wether or not the way I described above works?
     
    kiplarson, Jul 9, 2007 IP
  11. uglyboy

    uglyboy Peon

    Messages:
    1,963
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Yeah sorry, The way you described above does works.. If you have lots of affiliate links your gonna have a lot of extra files..
     
    uglyboy, Jul 12, 2007 IP
  12. denovo

    denovo Peon

    Messages:
    260
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #12
    This is the simplest masking code ever:
    
    <?
    header("Location: http://www.youraffiliatelink");
    ?>
    Code (markup):
    Paste it into notepad, put your link in, and save it as a *.php file.

    Give it whatever name you want. Put it in a folder named 'go'.

    Then, you use http://www.yoursite.com/go/whatever.php

    Yes, you will have one file per link. However, they look nice and clean. None of those question mark thingies. Works perfectly.

    Make sure your server is running php.
     
    denovo, Jul 12, 2007 IP
  13. uglyboy

    uglyboy Peon

    Messages:
    1,963
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #13
    There are at least two "?" in every php file!!!.


    IMO its better to have it all in one file.. anytime you need to edit any thing its in that one file

    really how hard is this
    <?php
    
    if ($m == "Name") {$link = "Affiliate link";}
    
    header("Location: $link"); // jump to hidden url
    exit();
    ?>
    PHP:
    I'm the end i suppose it comes down to which you find the easiest..
     
    uglyboy, Jul 12, 2007 IP
  14. WarBud

    WarBud Peon

    Messages:
    147
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I use the same thing. Works for me.

     
    WarBud, Jul 12, 2007 IP
  15. denovo

    denovo Peon

    Messages:
    260
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #15
    I meant in the URL.
     
    denovo, Jul 13, 2007 IP
  16. turbosatan

    turbosatan Well-Known Member

    Messages:
    957
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    135
    #16
    i use a couple of forms of affiliate link cloaking

    first one is profit protector which you can download for free just google it the other is using the browser redirect tool at www.echoecho.com

    i find the profit protector one is the most useful as it crea5tes a page which uses a frame i think to redirect the user so it appears that you are still on one site when the content is from another

    www.addme.com had a great url cloaker some time ago but i cant get to it anymore.
     
    turbosatan, Jul 13, 2007 IP
  17. GrassR00ts

    GrassR00ts Active Member

    Messages:
    614
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    58
    #17
    How can you set these up so bots will not follow? I have also heard that google will get into your code even if you have the nofollow tag, but I have also heard that bots do not read java.

    Any advice
     
    GrassR00ts, Jul 23, 2007 IP
  18. EmbryX

    EmbryX Banned

    Messages:
    86
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Thanks for these. It helped me :)
     
    EmbryX, Jul 23, 2007 IP
  19. turbosatan

    turbosatan Well-Known Member

    Messages:
    957
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    135
    #19
    how is this relevant?
     
    turbosatan, Jul 24, 2007 IP
  20. jukebox9988

    jukebox9988 Well-Known Member

    Messages:
    607
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    140
    #20
    Meta Refresh tags work well b/c You can post a message like "please stand by" while your site redirects to the destination.

    The disadvantages of just forwarding to the link is that your visitor may get confused or become hesitant to leave your site.

    A swell goodbye message may increase conversions. Works for me!
     
    jukebox9988, Jul 24, 2007 IP