PHP Affiliate Link Masking
If you’re like me and have jumped into affiliate marketing head on, you may not know some of the nuances of using affiliate links. Recently, James Seligman of JMCA Media schooled me on how to really easily set up PHP redirects for your affiliate links to make them a bit more user friendly. Let me share this knowledge with you!
- Open up Notepad or a similar text editing program.
- Add the following code:
<?
header(“location:affiliate-link-goes-here“);
?> - Replace the portion in italics above with the tracked link from the program of your choice.
- Save the file as a .php file with whatever name is easiest for you.
- Upload it to a designated diretory or folder on your website. Some possible names for the folder are recommends, deals, however you can call it whatever is easiest for you.
- When you want to add an affiliate link, just add the code <a href=”/recommends/affiliate.php”>Affiliate </a>
It’s that simple! I had head of PHP redirects before but, not knowing PHP very well myself, I never looked into how to do it. Luckily James was there to show me just how easy it is! And now you have a weekend project to go mask all your affiliate links!
Read More
