htaccess cookies and questions

ph4dge

Registered Member
Joined
Feb 7, 2007
Messages
53
Reaction score
28
Using .htaccess I thought it should be possible to stuff 2 affiliate cookies at the same time using this method. It seems to sort of work the way I imagined, however it only seems to load the second affiliate cookie not the first one...

I know I could use a simple iframe but I like the fact that viewing the source really doesn't give anything away using this .htaccess method.

.htaccess file:
Code:
Redirect /pic1.jpg http://affiliate-1.com
Redirect /pic2.jpg http://affiliate-2.com

.html file:
Code:
<img src="http://www.domain.com/pic1.jpg" />
<img src="http://www.domain.com/pic2.jpg" />

any idea's
 
Just thought of something else, in firefox the non-existant images don't display as anything...just white space. Using IE7 shows broken link boxes...the box with a red cross through it. Anyway of avoiding this ugly red cross thing??
 
load a 1x1 clear .gif instead of nothing

That sounds perfect but how can I do that when the img source is really not there, just points to the affiliate link?
 
That sounds perfect but how can I do that when the img source is really not there, just points to the affiliate link?

Instead of redirecting to affiliate link, redirect to a local php file which displays the 1x1, and opens the affiliate link. The path to that php file should be safely hidden in your .htaccess file. I'm going to play with it a bit, and will post my results.
 
that isnt going to work with the 1x1 image, you are going to have your php script requesting the page from the other side and the cookie hits the php code and then if you send these back to the client they are set from YOUR DOMAIN not remote domain, also the most likely reason the cookie isnt being set is the privacy settings, google p3p http header or something like that and have a read of how ie now interprets this, a lot of affiliate sites dont set this so as to avoid some of the stuffing issues here
 
Thanks Doug, I'll give that a try and post the details
 
OK problem solved, no longer displaying that red X in IE - see below:

Code:
<img src="http://www.domain.com/pic2.jpg" width="1" height="1" border="0" align="middle" />

however I seem to be left with the original issue that started this tread - doesn't seem to want to load both cookies for some reason.
 
OK problem solved, no longer displaying that red X in IE - see below:

Code:
<img src="domain.com/pic2.jpg" width="1" height="1" border="0" align="middle" />

however I seem to be left with the original issue that started this tread - doesn't seem to want to load both cookies for some reason.

Thanks for that bit of code, I couldn't get rid of them but all is good now :)
 
Are you using IE? I've noticed that IE seems to block the first cookie in a series, so maybe try loading 3 cookies with a "junk" cookie first in line. IE should catch that one, but miss the other 2.

Try that and let me know if it works.
 
Are you using IE? I've noticed that IE seems to block the first cookie in a series, so maybe try loading 3 cookies with a "junk" cookie first in line. IE should catch that one, but miss the other 2.

Try that and let me know if it works.

Still no good, wont load the amazon cookie for some reason. The rest of the cookies are fine. I'll keep working on this and report my findings
 
With amazon can I just load any old link or is there a "best" link to load as a stuffer?
 
the red X is a problem when posting into forums ... any ideas, yet?
 
I'm looking also how to remove the red X on IE7 when posting img on forums
 
Back
Top