0

I am making a website which has a sub-domain but some of the resources are shared between the main domain and the sub-domain such as the style sheet. Instead of duplicating the file into http://sub.domain.com from http://domain.com, is there a way to use "../style.css" to obtain it from the folder level up? I know I can if I access the website via http://domain.com/sub but not http://sub.domain.com because it looks in the folder above.

To clarify, this is not just for stylesheet, something like an include.php file for variables and functions would need to be included in the sub-domain from the main domain. Many thanks.

4

2 回答 2

3

为什么不直接使用样式表的完整路径?

无法使用 HTML 离开文档根目录。

于 2012-08-05T16:46:17.373 回答
0

是的,您可以从子域访问主域文件夹的内容。

于 2012-08-05T16:49:40.947 回答