I have a product that I've had for almost a year, and I'm looking to give it a facelift. One of the things I want to do for the affiliates is have their affiliate link not show up in the address bar when someone clicks their link. An example would be Michael Jones' Affiliat3 Cod3. When you get to his splash page, the address bar just shows his base URL with /sqvid.html on the end. How does one go about coding the site so it will do that?
Once the page loads you could put code to reload the page. PHP: <?phpif ($_GET['affiliateid'] != "") /* simple check to see if affiliate url was used, if it was we reload the page without it */{header('Location: http://my-domain-with-no-id-after-it.com/');### BEGIN BACKUP METHOD 1 ###echo '<META http-equiv="refresh" content="1;URL=http://my-domain-with-no-id-after-it.com/">';### BEGIN BACKUP METHOD 2###echo'<script type="text/javascript"><!--window.location = "http://my-domain-with-no-id-after-it.com/"//--></script>';}else{echo "" //we don't need to do anything because they are viewing the page directly}?> I coded this fairly quickly so you will need to test it for bugs. SPECIAL NOTES: Some browsers block the header location based redirect... There are two ways of getting around this... Method 1: Use a Meta Refresh (some browsers block this as well) Method 2: Load javascript to reload the page. If you use all 3 methods it should work 99.9999999999% of the time. I've used this and tested it on all major browsers and yet to see it be stopped.
I do it with an htaccess redirect. Code: Options +FollowSymLinks RewriteEngine On RewriteCond %{QUERY_STRING} ^hop= RewriteRule ^(.*)$ http://www.YOUR_DOMAIN_HERE.com/? [R=301,L]
@jmm223: very good method, using .htaccess slipped my mind lol, yeh way simpler that way. @OP No, that snippet of code will not work in a html page as PHP is a different language. To make it work you could do the following: 1. rename page from index.html to index.php 2. copy the snippet of code (checking first perhaps in a sub folder to make sure it's working correctly") 3. Place the code in the appropriate section of your html code... make sure the php tags are in there the begining tag is <?php the ending tag is ?> If you copy and paste the snippet it you don't need to add those tags obviously. But, they tell the web server to process that chunk off code as php as opposed to html. I recommend placing the code at the top of your page.
WHAT?!?! No...you wouldn't send them to any different link. The clickbank affiliate link is what they use. When the clickbank link is clicked, they go to the clickbank site which sets a cookie and then redirects to your sales page...except clickbank adds the "?hop=affiliateid" to the url. This redirect simply looks for the "hop=" and if it exists, sends them to your site without it. The "hop=" part is not needed unless you (the vendor) are using it for something. The cookie is what tracks the sale. If you don't know what an .htaccess file is, or how to use it...this method is probably not for you. But then again, the php method probably isn't either.
And that may indeed be the case. I'm a coding newb, and I know it. I'm just trying to figure out how some of this stuff works. I've managed to teach myself a LITTLE html and css, but I'm still almost completely ignorant when it comes to PHP, JavaScript, and anything else. I figured I could piece some of this together with help from people on here. Whether or not that's true is up for debate, but I figured I'd at least ask.