+2 votes
in Web & Google by (71.8k points)
I have created a subdomain to host image, js and css files. I want to unset the header cookie for these files. How can I do? I am using Apache.

1 Answer

+1 vote
by (353k points)
selected by
Best answer

Try to add the following code to your .htaccess file and see if you get the desired result. I have not tested these codes on my server.

#Unset header cookie for static files

<FilesMatch "\.(js|css|jpg|png|jpeg|gif|xml|json|txt|pdf|mov|avi|otf|woff|ico|swf)$">

<ifModule mod_headers.c>

RequestHeader unset Cookie

Header unset Cookie

Header unset Set-Cookie

Header unset Pragma

Header unset ETag

FileETag None