Stefan Dunn
Stefan Dunn

Reputation: 5513

PHP / HTML using "../" for subdomains

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.

Upvotes: 0

Views: 276

Answers (2)

Noah Passalacqua
Noah Passalacqua

Reputation: 802

yes you can access the contents of the main domain folder from the subdomain.

Upvotes: 0

Jordi Kroon
Jordi Kroon

Reputation: 2597

Why don't you just use the full path of the stylesheet?

It is not possible to go out of the document root with HTML.

Upvotes: 3

Related Questions