| | #1 |
| New Warrior Member Join Date: 2007 Location: Ontario, Canada
Posts: 12
Thanks: 5
Thanked 9 Times in 3 Posts
|
Ok, so I was browsing the net looking for a redirect script, I'm somewhat new to this. I wanted one that redirected, but still hid my affiliate link in the browser. The usual one that looks like this: <?php header('Location: aff link here'); ?> It cloaked my link, but my aff id still shows up on the affiliate site in the browser. so I found a blog that gave an awesome redirect script that also blocks search engines from following your affiliate link and therefore it won't get burried in the "serps", (whatever the heck that means...lol). I just know it's so your site isn't "dubbed" as an affiliate site, which Google doesn't like. anywho, I just need a little help on how to use it, what do i put where in the code? I understand how to make the php files and upload them along with the robot.txt file. Just need to know where to put the affiliate url and my website url. And wouldn't just putting a "no follow" thing for the robots work on all links? Here's the blog post from crt tard, or if you prefer you can read it here: Better Affiliate Link Cloaking for SEO | CTRtard.com - Internet Marketing with a Helmet ===================================== Better Affiliate Link Cloaking for SEO Posted by ctrtard on Nov 08, 2010 Not to be confused with referrer cloaking, cloaking affiliate links is typically done to present a nice looking URL to the user. The idea is, the savvier visitor might see a weird URL in the browser status bar and be less likely to click—so it’s best to cloak the link. If you’re using this technique for a landing page that you’re driving paid traffic to, then one of the usual link cloaking methods is fine. Cloaking affiliate links on a niche site or datafeed site that’s relying on organic traffic is a different ballgame. A big part of doing this successfully is avoiding duplicate content issues and being pegged as an affiliate site with no added value. Unless you’re retarded you’re already mixing up and/or adding some value to the stock content provided by the merchant, but one problem remains… When a search engine spider follows your out links, it will see them route through an affiliate network then to the merchant’s site. It’s easy to see that this can be used to identify your site as an affiliate site and therefore bury it in the SERPS. So what can you do? The Solution My epiphany happened when I was reading Rae Hoffman’s post about datafeed sites. Among the tips she offers is one that made a light bulb turn on in my head: Run your links through a blocked folder. Genius! To make this work, first create a directory in your site’s html root directory (usually “public_html”). You can name this directory anything. In this example, I’m going to name my directory “store”. The Redirect Script In this new directory “store”, create an index.php file with the following code: <?php // simple redirection script // pass a get variable 'item=' with value that's urlencoded and base64 encoded $item = $_GET['item']; $url = urldecode($item); $url = base64_decode($url); header("Location: $url"); ?> This code is designed to accept a URL passed using the “item” variable and then redirect the visitor. The Encoder Script This next bit of code is how you encode your links. <?php // Simple base64 encoder // Enter your affiliate link here // e.g. $url = "http://www.shareasale.com/m-pr.cfm?merchantID=12345&userID=77777&productID=123 456789"; $url = "http://ctrtard.com/"; $url = base64_encode($url); $url = urlencode($url); echo $url; ?> We encode the URL for the sole purposes of making it not look like an obvious affiliate link. For niche mini sites, you can just use this code to encode your links one at a time before placing them in your blog. For larger sites that have many affiliate links, you’ll want to incorporate this into your site building scripts to encode all the links before generating the html. Robots.txt The final thing you will want to do is setup a robots.txt file and place it in your site’s html root directory (public_html) that contains the following: User-agent: * Disallow: /store/ Usage In the above example, the URL I chose to encode is “http://ctrtard.com/” . The encoded version of this URL is this: aHR0cDovL2N0cnRhcmQuY29tLw%3D%3D So to use this, you’re link would be: http://yourdomain.com/store/?item=aH...QuY29tLw%3D%3D When the visitor clicks on the link, they will get redirected through your affiliate URL to the merchant’s site. The search spiders, on the other hand, won’t ever follow this link. That’s because they’re obeying the rule you set in your robots.txt file that tells them they are not allowed to spider anything in the “/store” directory. This prevents the search engines from indexing many links to a merchant and realizing you’re simply an affiliate for XYZ merchant. Sweet! You’ve just avoided leaving yet another fingerprint that says you’re a an affiliate site and gained a little advantage over the competition. Pro Tip There is no reason you can’t add on dummy variables to your links. The redirect script above only cares about the value of “item”. You can easily add other dummy variables to make your links look different. For example: http://yourdomain.com/store/?show=product-details&item=.... http://yourdomain.com/store/?zoomlevel=large&item=.... In both of these above cases, the “show” and “zoomlevel” will be ignored by the redirect script, but you still get the benefit of having it look like the on-page links are different. |
| "Spend 5% of your time figuring out what's wrong, and 95% deciding what you're gonna do about it!" | |
| |
| | #2 |
| HyperActive Warrior War Room Member Join Date: 2012
Posts: 290
Thanks: 13
Thanked 46 Times in 46 Posts
|
Sweet suggestion. The where would you put the code question is answered by it depends on the site. If you have a fairly static site you would put the encoder script in an area of the admin functions and use it to get the value of the encoded URL. Or if you have a dynamic site you would wrap the value of the link in the encoder before the page is displayed. You would only decode the item of the URL at the time someone clicked on it. HTH |
| | |
| |
| | #3 |
| Warrior Member Join Date: 2011 Location: United States
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
try to use a shortened url domain.
|
| |
| | #4 | |
| HyperActive Warrior War Room Member Join Date: 2006 Location: Solihull, United Kingdom.
Posts: 419
Thanks: 64
Thanked 271 Times in 50 Posts
Blog Entries: 1 |
You didn't think it would be *that* easy did you? ![]() -Frank Haywood | |
| | ||
| |
| | #5 | |
| HyperActive Warrior War Room Member Join Date: 2012
Posts: 290
Thanks: 13
Thanked 46 Times in 46 Posts
|
| |
| | ||
| |
| | #6 |
| Active Warrior War Room Member Join Date: 2012 Location: Semarang
Posts: 49
Thanks: 5
Thanked 4 Times in 4 Posts
|
Hi April, It is great tip. I will use your tip for my project. |
| |
|
| Bookmarks |
| Tags |
| great, php, question, redirect, script, seo, tip |
| |