views:

27

answers:

2

Hiya,

I'm trying to find out how to edit my htaccess to push all requests for files in:

http://www.domain.com/images

to head off to:

http://cdn.domain.com/images

The reasoning being i'd like to parrelise http requests over a number of domains/subdomains to speed up page load. Is this possible through apache scripting, or will I have to go and edit all the links?

also... if there is a scripting solution, will it still give the end user the benefit of serving files from multiple domains?

Thanks, Hugh

+2  A: 

That would be more taxing than editing the links. The browser would have to make 2 HTTP requests for each image. Your main server would still have to serve the redirection. Then, the browser would make a second request to the actual image.

My judgment: edit your links.

Daniel A. White
+1  A: 

Is there any reason you can't make cdn.domain.com be a cname for www.domain.com? If not, do this through bind, not apache.

Charles Stewart
That would make it simpler in that I wouldn't have to move files around, but i'd still need to edit the HTML to point the image links to the subdomain in order to get the speed benefit.
hfidgen