Tip: Affiliate link redirects - Earn more money

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ionic
    Confirmed User
    • May 2005
    • 443

    #1

    Tip: Affiliate link redirects - Earn more money

    It's friday and im in a good mood so thought i'd share this little tip with for any blog owners/site owners that have a lot of affiliate links on their pages.

    If you aren't already redirecting them, well you should be and here's how:

    Create a PHP file with the following code and your desired affiliate code/text.

    PHP Code:
    <?php
    
    $path = array(
        'reality-kings' => ' http://www.realitykings.com/main.htm?id=fapgallery&p=clean',
        'college-fuckfest' => 'http://signupsb.triplexcash.com/cgi/click?account=560307&site=2&program=2'
        );
    
    if (array_key_exists($_GET['id'], $path))
        header('Location: ' . $path[$_GET['id']]);
    
    ?>
    Save it as link.php

    Then in your .htaccess file (create one if you dont have one) add:
    Code:
    RewriteEngine On
    RewriteRule ^link/([/_0-9a-zA-Z-]+)$ link.php?id=$1
    Now in this example i used a realitykings.com affiliate link with the anchor text reality kings.

    To include that link on my pages i would just add a link to:

    http://www.domain.com/link/reality-kings

    When clicked that will redirect to the sponsor link

    Remember to block the /link folder in your robots.txt file

    Benefits of this technique:

    1. SEO benefits - google isnt fond of too many affiliate codes on landing pages and it also helps prevent bleeding or diluting of your pagerank score.

    2. Prevent any pc tools or other malware stripping out or replacing your affiliate code.

    3. Earn more money!
    for example today's nastydollars bonus day all i did was alter a few URL's in the link.php file and now all my inthevip/vipcrew/ links all go through the reality kings tours.

    Tomorrow i can just re-edit that file rather than the 100's of hard coded links on my sites.
  • martinsc
    Too lazy to set a custom title
    • Jun 2005
    • 27047

    #2
    thanks. i was wondering how to do that.
    Make Money

    Comment

    • ionic
      Confirmed User
      • May 2005
      • 443

      #3
      Note:

      Might not have been clear but in the link.php file you need to have a ',' after every line in url code except for the last line!

      Comment

      • *Fred*
        Registered User
        • Jul 2007
        • 69

        #4
        Nice tip!

        Comment

        • alby_persignup
          Confirmed User
          • May 2007
          • 3119

          #5
          thats cool! thanks
          OnProbation Links Directory | OnProbation Design Services | OnProbation Cash

          Comment

          • hardcoreblogger
            Confirmed User
            • Jul 2006
            • 761

            #6
            seems quite complicated to me, why not just put a simple redirect in htaccess?


            Comment

            • Oracle Porn
              Affiliate
              • Oct 2002
              • 24433

              #7
              Originally posted by hardcoreblogger
              seems quite complicated to me, why not just put a simple redirect in htaccess?
              if that's complicated you must be a true idiot!

              thank you very much for the code appreciated!


              Comment

              • Stomped
                Confirmed User
                • Nov 2003
                • 1105

                #8
                Didn't worked with me
                It shows a 404 error always...
                email: admin {AT} estomped [DOT] com

                Comment

                • Iron Fist
                  Too lazy to set a custom title
                  • Dec 2006
                  • 23400

                  #9
                  Originally posted by hardcoreblogger
                  seems quite complicated to me, why not just put a simple redirect in htaccess?
                  that's what I do... no need for extra overhead processing some PHP file...every cycle counts!
                  i like waffles

                  Comment

                  • Mike Semen
                    Confirmed User
                    • Dec 2001
                    • 2924

                    #10
                    Originally posted by sharphead
                    that's what I do... no need for extra overhead processing some PHP file...every cycle counts!
                    Care to share how you do it then?

                    ICQ 1454 81 522 |

                    Comment

                    • candyflip
                      Carpe Visio
                      • Jul 2002
                      • 43069

                      #11
                      Thanks for the tip.

                      Spend you some brain.
                      Email Me

                      Comment

                      • Jdoughs
                        Confirmed User
                        • Mar 2004
                        • 5794

                        #12
                        I'd love for everyone to adopt this.

                        Would increase the weight on my referal codes bigtime.
                        LinkSpun - Premier Adult Link Trading Community - ICQ - 464/\281/\250
                        Be Seen By New Webmasters/Affiliates * Target out webmasters/affiliates based on niches your sites are for less than $20 a month.
                        AmeriNOC - Proudly hosted @ AmeriNOC!

                        Comment

                        • Diligent
                          Confirmed User
                          • Aug 2003
                          • 1594

                          #13
                          Originally posted by Mike Semen
                          Care to share how you do it then?


                          Take the above PHP code, modify it like this:

                          Code:
                          <?php
                          
                          $path = 'http://www.YourSponsor.com/?affiliate=You&site=NastySite'
                          header('Location: ' . $path);
                          
                          ?>
                          Then rename the PHP file to YourSponsor-NastySite.php ...
                          ... and keep one PHP file like this for each site promoted in a central directory, like /links, and call them accordingly

                          Doesn't cut out PHP usage... but it'll save some cycles ;)
                          ~¤~ MORE MONEY ~¤~ VOD? XoD! ~¤~
                          ~¤~ ICQ# 9828 2461 ~¤~

                          Comment

                          • Diligent
                            Confirmed User
                            • Aug 2003
                            • 1594

                            #14
                            *NO* PHP at all btw:

                            Create subdirectories for each "promotion target" in the /links directory, like /links/YourSponsor-NasySite/ ...
                            ... and stuff this into each subdirectory's .htaccess (this will need editing each subdir's htaccess for the appropiate redirection target):

                            Code:
                            RewriteEngine On
                            RewriteRule ^.*$ http://www.YourSponsor.com/?affiliate=You&site=NastySite
                            ~¤~ MORE MONEY ~¤~ VOD? XoD! ~¤~
                            ~¤~ ICQ# 9828 2461 ~¤~

                            Comment

                            • Diligent
                              Confirmed User
                              • Aug 2003
                              • 1594

                              #15
                              Actually scratch my previous post, and use this instead:
                              (corrected a couple of errors, including making it slightly more SE friendly)

                              Code:
                              RewriteEngine On
                              RewriteRule ^$ http://www.YourSponsor.com/?affiliate=You&site=NastySite [R=301,L]
                              Last edited by Diligent; 03-09-2008, 01:30 PM.
                              ~¤~ MORE MONEY ~¤~ VOD? XoD! ~¤~
                              ~¤~ ICQ# 9828 2461 ~¤~

                              Comment

                              • bDok
                                Confirmed User
                                • Feb 2005
                                • 1917

                                #16
                                nice tip.
                                Take it to the next level and create a database of the links.

                                So then you can have a nice control panel that handles it all.
                                =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                                Warriors come out to plaAAaayyy!
                                =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

                                Comment

                                • Diligent
                                  Confirmed User
                                  • Aug 2003
                                  • 1594

                                  #17
                                  bDok: niiice thinking!
                                  ~¤~ MORE MONEY ~¤~ VOD? XoD! ~¤~
                                  ~¤~ ICQ# 9828 2461 ~¤~

                                  Comment

                                  • kmanrox
                                    aka K-Man
                                    • Oct 2001
                                    • 29295

                                    #18
                                    its a very good tip... mainly the reasoning on how its easy to swap out hundreds of links easily.... although you could search and replace in your database too if need by...

                                    i've always liked this 100&#37; automatic plugin;

                                    http://w-shadow.com/blog/2007/07/28/...for-wordpress/

                                    I know it doesnt give you easy control over where the links point, but i have a technical background and a couple programmers on staff that im sure would easily search and replace (grep) if i ever needed... never needed to though.
                                    Crypto HODLr
                                    Crypto mining
                                    Angel investor

                                    Comment

                                    • Mike Semen
                                      Confirmed User
                                      • Dec 2001
                                      • 2924

                                      #19
                                      Awesome tips. Thanks Diligent.

                                      I might well be dreaming that this happened - a useful thread on GFY. Wow.
                                      ICQ 1454 81 522 |

                                      Comment

                                      • Jens Van Assterdam
                                        The Dupre Pimp
                                        • Feb 2008
                                        • 6677

                                        #20
                                        great tip,was searching for something like this
                                        Read TOS for signature rules

                                        Comment

                                        • Diligent
                                          Confirmed User
                                          • Aug 2003
                                          • 1594

                                          #21
                                          Thanks for the thanks guys, useful stuff is always nice eh?
                                          (Keep gratiuty in store for ionic as well though, he initiated this stuff here)

                                          Which brings me to correct my first post in this thread, can't believe how sloppy I was with the code hehe:

                                          If You wanna go the PHP route, the way I suggested, I missed an important semicolon.. so here we go again, fully correct this time:

                                          Code:
                                          <?php
                                          
                                          $path = 'http://www.YourSponsor.com/?affiliate=You&site=NastySite';
                                          header('Location: ' . $path);
                                          
                                          ?>
                                          (Semicolons are needed at the end of pretty much each instruction line in PHP)
                                          Last edited by Diligent; 03-09-2008, 03:46 PM.
                                          ~¤~ MORE MONEY ~¤~ VOD? XoD! ~¤~
                                          ~¤~ ICQ# 9828 2461 ~¤~

                                          Comment

                                          • FlexxAeon
                                            Confirmed User
                                            • May 2003
                                            • 3765

                                            #22
                                            so google prefers redirects over ref codes?
                                            flexx [dot] aeon [at] gmail

                                            Comment

                                            • Iron Fist
                                              Too lazy to set a custom title
                                              • Dec 2006
                                              • 23400

                                              #23
                                              Originally posted by Mike Semen
                                              Care to share how you do it then?

                                              Sure...

                                              RewriteEngine on
                                              Options +FollowSymlinks
                                              RewriteRule ^go/ladyboygold/ http://join.ladyboygold.com/track/NzkwOjk6Ng/ [R=301,NC]


                                              then go to http://www.yourdomain.com/go/ladyboygold/ and apache automatically redirects to the url above. I've tested this with join links, test signups and such and this method works the best. Granted the .htaccess file can get to be a bit large, its still better than running PHP that essentially does the same thing.
                                              i like waffles

                                              Comment

                                              • Tempest
                                                Too lazy to set a custom title
                                                • May 2004
                                                • 10217

                                                #24
                                                In the long run, the ionic method is far better from an updating standpoint when you run a ton of sites on many different servers... here's another tip on how to use this (been doing this myself for 3 years now)... If you have multiple sites on one server, create a common directory somewhere...

                                                example.

                                                /www/domain1.com/html
                                                /www/domain2.com/html
                                                /www/domain3.com/html
                                                /www/domain4.com/html
                                                /www/links <- create this one.

                                                Now put that links.php file in that directory. i.e.:
                                                /www/links/links.php

                                                Now for each of your sites, you simple put a links.php file in there that includes that core file (as well as the .htaccess file). i.e.
                                                /www/domain1.com/html/links/links.php
                                                /www/domain2.com/html/links/links.php
                                                /www/domain3.com/html/links/links.php
                                                /www/domain4.com/html/links/links.php
                                                /www/links/links.php <- core file

                                                the links.php file for each domain just has the following in it:
                                                <?php @include('/www/links/links.php'); ?>

                                                Now you only have to update one file per server and ALL your sites are updated at once.

                                                That code can be expanded like crazy to add in campaign tracking per site, log the clicks or whatever... the only issue is that you will end up with 1000s of links in that file which will make it very big.. At that point you need to start breaking it up into sections. Could be done per sponsor. eg:

                                                these ones contain all the links:
                                                /www/links/nastydollars.php
                                                /www/links/bangbros.php
                                                /www/links/topbucks.php

                                                then each site could be
                                                /www/domain1.com/html/links/nd/links.php
                                                /www/domain1.com/html/links/bbo/links.php
                                                /www/domain1.com/html/links/tb/links.php

                                                And those links files include the approriate sponsor core link file. You'll need to adjust the .htaccess file for the correct path.

                                                Couple other things.. You should send a proper 404 if the script fails etc. So I'd mod it like this and also do a couple things to try and cut down on the size of the file when you start adding more and more links..

                                                Code:
                                                <?php
                                                	$key = (isset($_GET['id']) ? trim($_GET['id']) : '');
                                                	if( $key == '' ){
                                                		do404();
                                                	}
                                                	$links = array(
                                                		'reality-kings' => 'www.realitykings.com/main.htm?id=fapgallery&p=clean',
                                                		'college-fuckfest' => 'signupsb.triplexcash.com/cgi/click?account=560307&site=2&program=2'
                                                	);
                                                	if( isset($links[$key]) ){
                                                		$url = (substr($links[$key], 0, 4) == 'http' ? $links[$key] : 'http://'.$links[$key]);
                                                		header("Location: $url");
                                                		exit;
                                                	}
                                                	do404();
                                                
                                                function do404(){
                                                	header('HTTP/1.1 404 Not Found');
                                                ?><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
                                                <HTML><HEAD>
                                                <TITLE>404 Not Found</TITLE>
                                                </HEAD><BODY>
                                                <H1>Not Found</H1>
                                                The requested URL was not found on this server.
                                                </BODY></HTML>
                                                <?php
                                                	exit;
                                                }
                                                ?>

                                                Comment

                                                • Iron Fist
                                                  Too lazy to set a custom title
                                                  • Dec 2006
                                                  • 23400

                                                  #25
                                                  The same can be done for custom galleries... just put symbolic links to your other image directories and then put in different header/footer images in that specific virtual directory and you've duplicated the content without wasting space
                                                  i like waffles

                                                  Comment

                                                  • papill0n
                                                    Unregistered Abuser
                                                    • Oct 2007
                                                    • 15547

                                                    #26
                                                    Originally posted by Diligent
                                                    Actually scratch my previous post, and use this instead:
                                                    (corrected a couple of errors, including making it slightly more SE friendly)

                                                    Code:
                                                    RewriteEngine On
                                                    RewriteRule ^$ http://www.YourSponsor.com/?affiliate=You&site=NastySite [R=301,L]
                                                    I like that

                                                    Comment

                                                    • qxm
                                                      Confirmed User
                                                      • Jul 2006
                                                      • 5970

                                                      #27
                                                      I'm shocked! An actual useful thread in GFY!! .............the world is coming to an end.......bookmarked since this happens once every million posts

                                                      ICQ: 266990876

                                                      Comment

                                                      Working...