0

I am looking for a solution on a LAMP server to keep a site cookieless such as "example.com", where static content is served from "static.example.com", and with rules in place to rewrite requests for "www.example.com" to "example.com". I am really hoping to avoid setting up a cookieless domain for the static content due to an unanswered SEO concern with regards to CNAMEing to a CDN. Is there a way, (or safe hack), that can be implemented where a second domain such as "www.example2.com" is CNAMEd, aliased, or otherwise used with "example.com" to somehow trick a php application into maintaining state with a cookie dropped on "www.example2.com" therefore keeping all of "example.com" cookieless?

If such a solution is feasible, what implications would exists with regards to SSL and cross-browser compatibility other than requiring users to accept cookies from 3rd party domains and possibly needing an additional SSL to keep the cookie secure?

Thanks in advance to all.

1 Answers1

1

You can host your static content anywhere. I recommend setting up a CNAME to your static assets so you can have a nice domain like static.sample.com to reference in your code. Regarding www.example.com and example.com, you should point example.com to your IP and www.example.com is simply a CNAME that points to example.com.

Regarding cookies, I'm not sure I follow your question, but you can set cookies on example.com that will show on any variation of that domain (app1.example.com, static.example.com www.example.com)

Simply prepend the domain name with a period to have the cookie apply to all subdomains: ".example.com"

Erik Giberti
  • 255
  • 1
  • 8