Serving static content from a cookie domain

I am working on Yslow and google page speed recommendation to serve static content from free cookie domain.

I created two subdomains to serve images and JS and CSS files

static.images.mymaindomainname.com
static.mymaindomainname.com

      

I even configured them to point to the same domain (alias) and they seem to work fine. I am confused about using this subdomain to serve static content.

In my CSS file I am using images as images/my_image.jpg

and which allow www.mymaindomainname.com/images/my_image.jpg

and now I have to point this to subdomain, I need to change each image path with subdomain url as

images/my_image.jpg-->static.images.mymaindomainname.com/images/my_image.jpg

      

the same happens with the JS file and we have a lot of CSS files. Do I need to change the path for every single entry? Please suggest

I am using wordpress for portal development.

+3


source to share


1 answer


You can dynamically rewrite urls without touching your current css or js files using .htaccess and mod_rewrite. Send a message:



site is 5x faster via mod_rewrite, but CSS images are broken

0


source







All Articles