Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a PHP5/Apache2/MySQL website. Now in the folder structure under root I have an root\images folder that just has images. I also have a root\skin\images folder again has only images. If I wanted to serve the two images folders over a CDN how would I do this (without changing php etc, just using Apache, possible?)

Currently Apache directly handles all requests to the site. I have root access to the webserver so I can change the setup.

share|improve this question
up vote 0 down vote accepted

CDNs operate in a way then when a DNS lookup is made, it returns the closest (i.e. fastest) server to the users location. That's why you will find, for example: = website = CDN with images

You'll need to have a different (CDN'd) hostname for your images, I'm afraid.

If you use Apache's mod_substitute, you should be able to replace the images with ones on such a CDN domain so you don't have to make any PHP changes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.