www.mysite/recommends redirect

Discussion in 'Programming' started by Swerd, Aug 8, 2007.

  1. #1
    Hi,

    I see on a lot of blogs when you click on links to products the link shows up as www.theirsite.com/recommends .. it then redirects with their affiliate link..


    How do I set this up on my blog?
     
    Swerd, Aug 8, 2007 IP
  2. caj

    caj Active Member

    Messages:
    748
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    75
    #2
    I don't know how they do it - but it's using a php coding with some modification on the .htaccess file. It's sort of hiding/cloaking your affiliate links
     
    caj, Aug 8, 2007 IP
  3. merianos

    merianos Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    There are several ways to do that . . .

    i will show you the Javascript way but prefere the Server Side. Is better . . .

    function redirectToSomewhere()
    {
    window.location.href = "http://www.somesite.ext/yourdirectory/yourpage.ext"
    }


    window.setTimeout('redirectToSomewhere()',3500);

    In last line of my code the 3500 is mean 3.5 seconds. So in 3.5 seconds the windows will call the function redirectToSomewhere().

    In function redirectToSomewhere() the only think you do is tochange the location of the window address.

    By using session varibles or post or get variables you can pass to the advertising page any information you want to the page you want to show.

    The best way is the Server Side Scripting. Because the server you know that it executes the scripts. The client maybe don't executing scriptes.

    Another way is this :

    <meta http-equiv="refresh" content="5; url=http://www.hscripts.com">

    and the best one in PHP :

    <?
    $seconds = 5;
    header(”Refresh: $seconds; url=http://yourURLhere.com”);
    ?>
     
    merianos, Aug 8, 2007 IP
  4. caj

    caj Active Member

    Messages:
    748
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    75
    #4

    Merianos, let's say I have 20 affiliate links, do I have to put all 20 affiliate link in the "url=http://yourURLhere.com"? then add it to my .htaccess file?
     
    caj, Aug 9, 2007 IP
  5. merianos

    merianos Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Why to use .htaccess ? ? ?

    just do it as simple as posible . . .
     
    merianos, Aug 10, 2007 IP
  6. Swerd

    Swerd Active Member

    Messages:
    1,657
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    90
    #6
    can you show the server side way?
     
    Swerd, Aug 16, 2007 IP