Category Archives: affiliate

Rewriting code for affiliate links

Let me preface this by saying that writing .htaccess files drives me completely insane...

I've got a sales website with a bunch of affiliates that should redirect to a shop site and then send the user back to the original sales site.

So what I want to do is have something like:

www.example.com/item/randomaffiliatenumber

(the "promo" directory doesn't actually exist).

redirect to:

subdomain.shop.com/item/randomaffiliatenumber

I mean I suppose I could MAKE an "item" directory with the same contents as "/" but that shouldn't be necessary. The main thing I want to do is have the affiliate code be passed to the shop site.

I tried:

RewriteRule ^item/(.*)$ http://subdomain.shop.com/item/$1

...but that didn't work.(Gave me a 404 saying "promo" wasn't found).

.htaccess – URL masking [on hold]

Recently I've been trying to figure something out, but I just can't get my head around it! What I'm trying to do is show the content of www.myaffiliate.com/?product=43&aid=343 but have my URL as www.mywebsite.com/product. How could I do this?

I've heard that this may be something called URL masking, but I couldn't seem to do anything with it. I took the iframe approach, but it shows the URL in the source code, and that would lead to people possibly stealing my commissions. And besides that, they also have a frame-breaker

If you could suggest some sort of way that I could keep the URL the same whilst changing content, that would be great. Thank you!