Page 1 of 1

Setting up Cookieless Domain

Posted: Tue Nov 16, 2010 9:28 pm
by getdown
I'd like to move as much of my static content as possible to a cookieless domain. Down the line I'll probably look into and set up a cnd (CND for Joomla! by NoNumbers! seems very well supported). However, what I am contemplating at the moment is simply hard coding an absolute URL into all of my css/articles/ect to the static domain.

Is it possible to point that domain at the same Joomla root folder so that I don't have to manually copy the static content to a sub-directory to keep the cookie from being set?

I was thinking possible to to prevent cookies from being set on a particular domain via .htaccess, and possibly re-write any url request to the static domain to the primary domain to prevent access to the site through the static domain.

There might be a better way to do this, if so feel free to speak up.

live site =
static site =
Both point to joomla root directory

Can I use .htaccess to prevent access to any non-static content on

Can I use .htaccess to always un-set any cookies on only?

Re: Setting up Cookieless Domain

Posted: Tue Nov 16, 2010 9:56 pm
by getdown
It seems like this would work if I could use .htaccess to limit the static domain to serving only static content:

Than I could use a CND plugin to request all of the static content from the static domain.

Would I need to do anything in that case to make sure that the static domain never set any cookies?

Re: Setting up Cookieless Domain

Posted: Fri Nov 19, 2010 6:44 am
by almooj-craig
I would be better to set up a new paired down virtual host for the other sub domains. Currently I use and for static resources and for content, these all point to the same document root directory. There is no cookie set for the static elements that are on a or b, but the one static .js file which is on the www domain does get cookies set.

For example if you rewrote all of your images into the a directory using mod_rewrite it would waist a lot of time because of the 301 redirects, so you really need to use a preg_replace_callback to change the domains in the html before you cache or serve it out. If you use two sub domains for the static content most browsers will be able to download more content concurrently. Just use an algorithm on the file names so that they always get assigned to the correct static domain.

In your a and b sub domains you can use mod_rewrite to move content back to www.


Re: Setting up Cookieless Domain

Posted: Mon Feb 01, 2016 7:39 pm
by OlympiaWatch
Is there an extension out there that does all of the above without having to edit the core code of the site and other extensions to be able to make these changes.

And then it would also put lines in your .htaccess file to redirect anything from or that does not match the filetypes or folder locations of your static content, back to (or you could add these lines manually etc.) and you could split it into say images and javascript/css and have one group per domain (or even use a 3rd domain perhaps?)

Surely there must be an interest in this kind of stuff to the extent that someone has built an extension or two that do this?

Re: Setting up Cookieless Domain [SOLVED]

Posted: Tue Mar 08, 2016 8:29 am
by astarmaths
Soled it.
I disabled all cookies with an extension.
When I enabled cookies, I could log in and register.