Apache MOD_REWRITE Domain Level Cookie
- by BigMadKev
I need to deal with Affiliate Tracking on our website.
In our .htaccess we have:
RewriteCond %{QUERY_STRING} affiliate=(.*)
RewriteRule ^(.*)$ $1? [NC,R,L,co=AFFID:%1:%{HTTP:Host}:7200:/]
Which creates a COOKIE called AFFID with the value of the URL Parameter affiliate.
But the Cookie is not for the whole domain, i.e. Going to http://www.domain.com/?affiliate=bmk sets the AFFID cookie with the value bmk for .www.domain.com but I would like ti to be for .domain.com so that it can be used across our secure domain which will be secure.domain.com
Any help would be appreciated
Cheers