跨同一服务器上托管的域访问文件 [英] accessing files across domains that are hosted on the same server

查看:56
本文介绍了跨同一服务器上托管的域访问文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个Web服务器上有两个域.我要在该站点上使用domain2的domain1上有图像和其他文件.由于种种原因,在这种特定情况下,我不能仅将文件复制到第二个域中.

I have two domains sitting on the one webserver. I have images and other files on domain1 that I want to use on the site for domain2. For a whole shedload of reasons, I can't just copy the files over to the second domain in this particular scenario.

如果我是直接从另一个站点通过代码中的http调用来调用这些文件,那么这将严重影响我的加载时间和带宽,因为它们都存储在同一台物理服务器上吗?

If I'm calling these files via http calls in the code directly from the other site, will this significantly impact my loadtimes and bandwidth as they are both stored on the same physical server?

如果有关系,我们正在谈论的是LAMP环境.

if it matters, we're talking about a LAMP environment.

提前谢谢!

推荐答案

否.服务HTTP请求时,Apache在不同域之间没有区别.有效地在一台服务器上拥有一个域就等于在一台服务器上具有两个域.

No. Apache does not make difference between different domains when serving HTTP requests. Effectively having one domain on one server is the same as having two domains on one server.

只有在进行AJAX调用时,跨域才成为问题.

Only if you are doing AJAX calls cross-domains become an issue.

这篇关于跨同一服务器上托管的域访问文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆