If I'm using subfolders instead of subdomains to market my affiliate products, what's the easiest way to mask these links? Please explain carefully for the newb.
Use a 301 redirect in .htaccess so it redirects from the subfolder to the affiliate link. The subfolder is virtual you don't need to physically create it.
Am I supposed to open .htaccess file in the same directory as subfolder and edit? The thing is...I have add-on domains in which this site is one of them. So, right now my landing page is like this: www. add-on-site/subfolderA/index.htm I want text links on this page and all other pages under subfolderA to go to affiliate. Hope this helps. Again, please explain in baby steps for me so I can understand.
Why not use a redirect service or script? Just be sure to add the '?afsrc=1', amazingly enough I started see a little increase in my affiliate income when adding this to all my redirects. I used to use '.htaccess' redirects, but that got to be a huge pain after a few hundred links. Best, Justin
If you don't want your visitors to think it's an affiliate link, make a folder named "go" or something, then simple make a new php file each time that does a simple redirect to your affiliate link: <meta http-equiv="refresh" content="0;url=http://www.myafflink.com"> Code (markup): If you're using Wordpress or something, there are plugins to make this task easier.
OK, maybe I just don't understand what masking is... I did the htaccess method by inserting this into the htaccess file in the same directory as my product pages: Redirect 301 /product http://youraffiliatelinkhere.tld?123 I assumed that "product" is the subfolder the files are in and changed it to reflect that. Is this right? At any rate, it's redirecting that site to my affiliate site now. I thought we were just changing/masking the link on the status bar so the customer doesn't see something like "youraffiliatelinkhere.tld?123" when they mouse over the link.
Okay, I'm trying to do this using the PHP redirct method. However, it STILL ISN'T WORKING CORRECTLY AND IT'S REALLY PISSING ME OFF! Here is the error message i'm getting after clicking on the affiliate link on the landing page that should go to "go.php" page: Warning: Cannot modify header information - headers already sent by (output started at /home/mystupidwebsitethatdoesntwork/go.php:6) in /home/mystupidwebsitethatdoesntwork.com/go.php on line 7 What the hell is causing this? Do I have the PHP page set up wrong? Here is the code for the PHP page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <? header('location: http://theAffiliateLinkIamUsing'); ?> </body> </html> Code (markup): I also tried putting the code in header that that won't work either. Someone please help me with this before I pull every freaking strand of hair out of my head!
The simplist way I know of to create a PHP redirect is by doing the following: - Create a subfolder under you website called "go". It can be anything you want, but I've seen lots of people use the go directory name. - Create a file for your affiliate (for example, myaffiliate.php) and insert the following code: <?php header("Location: http://youraffiliatelink_withID"); ?> Code (markup): - Save the file. When you want to direct users to your affiliate masked link, do something like, http: // www .mysite.com/go/myaffiliate.php, as your anchor link. When the user clicks on your link, they'll be redirected to the affiliate site. Hope this helps! PS: Don't put spaces in your anchor link like I did...I put them there because I didn't know how to make it stop displaying it as a link.
I use a program called PHPLinkCloaker - (the URL will be obvious...) - it costs just $9.95, and uses a MySql database. What I like about it is that it keeps track of how many people use your link to click out to the affiliate program - so you can see just how much traffic your website is sending out on its way. This can really be useful if you are hyping a number of affiliate programs, you can see what people are interested in, and be able to kill off unproductive campaigns, or revise the ad copy when you see that very few people are clicking through. I've always been a big fan of information - you need all the information about what's happening as you can get. With good information, you can make good decisions - and that means more money.
Here is the problem with your php file. You are outputting HTML and then you are sending the header with the php function. Get rid of the rest of the junk and just send the header redirect. The headers must be sent before anything else, that's why you're seeing the error. Outputting headers always must happen before any other output.