+2 votes
in Web & Google by (15.3k 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

0 votes
by (27.1k points)

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