假设我有 domain.com 和其他五个子域。
子域存储在与 domain.com 不同的文件夹中
在 domain.com 中,我将拥有 3 个文件夹,当我在其他子域中时,我需要访问这些文件夹,我将访问 php、css、图像、任何东西。
每个子域都需要有自己的 htaccess。
做到这一点的最佳方法是什么?我读过一些关于 open basedir 的文章,但我不确定这是否是最好的方法。也不知道它是如何工作的。
提前致谢
假设我有 domain.com 和其他五个子域。
子域存储在与 domain.com 不同的文件夹中
在 domain.com 中,我将拥有 3 个文件夹,当我在其他子域中时,我需要访问这些文件夹,我将访问 php、css、图像、任何东西。
每个子域都需要有自己的 htaccess。
做到这一点的最佳方法是什么?我读过一些关于 open basedir 的文章,但我不确定这是否是最好的方法。也不知道它是如何工作的。
提前致谢
if you don't want to go through the stress of editing .htaccess or you dont have shell access, then just use URL paths for resources like images
e.g. "http://example.com/images/prev.png"
for include files you can use absolute paths "/home/example/public_html/inc/test_subd.php"
如果它在不同的服务器上,您可以使用该.htaccess
文件将请求代理到原始域(如果您启用了mod_rewrite和mod_proxy )。
RewriteRule ^images/(.*)$ http://www.example.com/images/$1 [P]
如果它们都在同一台服务器上: