开发者

Apache / htaccess rewrite - From domain to subdomain

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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜