GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Tip: Affiliate link redirects - Earn more money (https://gfy.com/showthread.php?t=763114)

ionic 08-24-2007 05:27 AM

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 08-24-2007 05:30 AM

thanks. i was wondering how to do that.

ionic 08-24-2007 05:32 AM

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!

*Fred* 08-24-2007 09:26 AM

Nice tip!

alby_persignup 08-24-2007 11:21 AM

thats cool! thanks

hardcoreblogger 08-24-2007 11:27 AM

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

Oracle Porn 09-07-2007 05:33 AM

Quote:

Originally Posted by hardcoreblogger (Post 12983202)
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! :)

Stomped 03-09-2008 12:27 PM

Didn't worked with me
It shows a 404 error always...

Iron Fist 03-09-2008 12:50 PM

Quote:

Originally Posted by hardcoreblogger (Post 12983202)
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!

Mike Semen 03-09-2008 01:17 PM

Quote:

Originally Posted by sharphead (Post 13898936)
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?

:)

candyflip 03-09-2008 01:27 PM

Thanks for the tip.

Jdoughs 03-09-2008 01:33 PM

I'd love for everyone to adopt this.

Would increase the weight on my referal codes bigtime.

Diligent 03-09-2008 02:05 PM

Quote:

Originally Posted by Mike Semen (Post 13898984)
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 ;)

Diligent 03-09-2008 02:22 PM

*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


Diligent 03-09-2008 02:27 PM

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]


bDok 03-09-2008 02:46 PM

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.:pimp:pimp:pimp

Diligent 03-09-2008 02:54 PM

bDok: niiice thinking! :thumbsup

kmanrox 03-09-2008 02:59 PM

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.

Mike Semen 03-09-2008 03:49 PM

Awesome tips. Thanks Diligent.

I might well be dreaming that this happened - a useful thread on GFY. Wow.

Jens Van Assterdam 03-09-2008 04:21 PM

great tip,was searching for something like this :)

Diligent 03-09-2008 04:43 PM

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)

FlexxAeon 03-09-2008 05:27 PM

so google prefers redirects over ref codes?

Iron Fist 03-09-2008 05:45 PM

Quote:

Originally Posted by Mike Semen (Post 13898984)
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.

Tempest 03-09-2008 06:56 PM

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;
}
?>


Iron Fist 03-09-2008 07:10 PM

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 :)

papill0n 03-09-2008 09:21 PM

Quote:

Originally Posted by Diligent (Post 13899140)
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 :thumbsup

qxm 03-09-2008 09:27 PM

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


All times are GMT -7. The time now is 07:17 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123