Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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:

http://www.example.com/ = website
http://images.example.com/something.jpg = 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

 
discard

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.