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

Help: PHP Redirect For Affiliate CPA Links

Discussion in 'CPA' started by painreliefbullet, Dec 23, 2011.

  1. painreliefbullet

    painreliefbullet Registered Member

    Joined:
    May 31, 2011
    Messages:
    68
    Likes Received:
    12
    Occupation:
    Internet Marketing
    Location:
    Arizona, USA
    I have domains that use to forward offers to, but right now I need to do php redirect as my direct links get my yahoo answers posts flagged down. I want to try this method, but I'm not paying for hosting anywhere. Am I missing something to where I can do this with my existing domains even though I'm not paying for hosting? I buy my domains thru godaddy and yahoo mainly. I need to upload a php file somewhere, I'm just not quite understanding this process and I need to mask click bank affiliate links without buying more domains when I may get flagged down anyway.
     
  2. GimmeMoney

    GimmeMoney Regular Member

    Joined:
    Apr 19, 2009
    Messages:
    401
    Likes Received:
    511
    Just get free hosting at 000webhost.com and upload your php file there.
     
  3. painreliefbullet

    painreliefbullet Registered Member

    Joined:
    May 31, 2011
    Messages:
    68
    Likes Received:
    12
    Occupation:
    Internet Marketing
    Location:
    Arizona, USA
    that's awesome, thank you. i'm gonna set that up right now and then get filezilla to upload it. thank you so much.
     
  4. mutatedllama

    mutatedllama Regular Member

    Joined:
    Feb 8, 2011
    Messages:
    445
    Likes Received:
    462
    Try using something like http://zcu.be/ to shorten your links. bit.ly may be blocked on Yahoo answers but other lesser known ones aren't :)
     
  5. omagad

    omagad Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 10, 2010
    Messages:
    256
    Likes Received:
    290
    If you want to use your existing domains for forwarding you can host them @blogger. I don't know about Y!, but for godaddy they now have (blogger) a one-button-set-everithing, beside it is quite fast and free to use.

    As for redirecting, a 301 php redirect it's not always the best option. Some script can bypass, because of the 301, the domain and still get to the live site.

    So, if you want to try blogger (which does not have php support), you can place this little code (javascript) between head ... /head and you're all set. Also, javascript redirection (being a client side redirect) will leave the referrer as the redirection domain, and not the actual source (like a 301 will do).

    HTML:
    <script language='javascript'>
    document.location='http://YOURURLHERE';
    </script>
     
  6. Stupid Smurf

    Stupid Smurf Regular Member

    Joined:
    Dec 12, 2011
    Messages:
    337
    Likes Received:
    138
    Occupation:
    Watcher.
    Location:
    NY
    Home Page:
    Got a question on this. So how exactly does this javascript cloak work?

    Normally, I do a redirect through my domain with a PHP array, which doesn't cover up, always?

    So, to get the java to work, do you need to direct the person to the blog and have them click on a link on the blog or can it be set up so it takes them to the offer page (showing the blog as referrer)? If yes, how please? :)

    Thanks.
     
  7. allinet

    allinet Registered Member

    Joined:
    Mar 28, 2011
    Messages:
    91
    Likes Received:
    22
    Occupation:
    Computer and Laptop Service Specialist
    Location:
    Lockport, IL
    Home Page:
    FTP this .php file to a new directory inside a new directory named RECOMMENDS on your host and name the file - index.php

    <?php
    header("location: http://www.AFFILIATE_LINK");
    ?>

    Now your masked link is DOMAINNAME\RECOMMENDS\NEWDIRECTORY\index.php
    and it will redirect to your affiliate link
     
    Last edited: Dec 24, 2011
  8. ihatecaptcha

    ihatecaptcha BANNED BANNED

    Joined:
    Jul 31, 2010
    Messages:
    593
    Likes Received:
    78


    here's random redirect




    Code:
    <?php
    $num = Rand (1,2);
    switch ($num) {
    case 1: header('Location: http://affiliate.com');
    break;
    case 2: header('Location: http://affiliate.com');
    break;
    }
    ?> 
    You can add more if you want
     
  9. Stupid Smurf

    Stupid Smurf Regular Member

    Joined:
    Dec 12, 2011
    Messages:
    337
    Likes Received:
    138
    Occupation:
    Watcher.
    Location:
    NY
    Home Page:
    Was that to me or the OP?

    This is what I put in my index.php file that I upload to a folder (FOLDERNAME).

    Code:
    <?php 
    $link=array(
    WORD1=>"AFFILIATE LINK",
    WORD2=>"AFFILIATE LINK",
    
    ); 
    $url=$link[$_GET['WORD']]; 
    header("Location: ".$url); 
    ?>
    Then link to it with: mydomaindotcom/FOLDERNAME/?WORD=WORD1

    WORD1 and WORD2 could also just be 1 and 2. Just used those as examples and you can have more then 2.

    So this masks the affiliate link, but would the referrer be shown as my domain or the actual referrer?

    Thanks.

    Edit: Guess this would answer your question too OP, if it masks referring as well.
     
  10. omagad

    omagad Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 10, 2010
    Messages:
    256
    Likes Received:
    290
    Ok, you don't need to take my word for it, you can try it yourself.
    You will need 4 pages like so (put them all in the same folder):

    PAGE1 (index.html)

    Code:
    <html>
    <head>
    </head>
    <body>
    <a href="php.php">php</a><br><br>
    <a href="js.html">js</a><br><br>
    </body>
    </html>
    PAGE2 (js.html)

    Code:
    <html>
    <head>
    <script language='javascript'>
    document.location='offer.php';
    </script>
    </head>
    <body>
    </body>
    </html>
    PAGE3 (php.php)

    Code:
    <?php
    header("location: offer.php");
    ?>
    PAGE4 (offer.php)

    Code:
    <?php
    echo $_SERVER['HTTP_REFERER'];
    ?>
    Go to index.html and open both of the links in a new tab, you will see these results:

    Code:
    PHP REDIRECT: http://mysite.com/
    JS  REDIRECT: http://mysite.com/js.html
    So, which one truly fakes the referrer?
     
    Last edited: Dec 24, 2011