hidefind
hidefind

Reputation: 1

Relative path to CSS file for subdomains

I'm not sure what I'm doing wrong here. I'm just trying to use the CSSfiles in /css/ as a management point for the rest of the page and have tried "../../css/test1.css" and "../css/test1.css" for relative paths in my link hrefs but I can't get it to point from the subdomains correctly without supplying the absolute paths (domain.com/css/test1.css, domain.com/css/test2.css, ect) to the css files. index.php in the root displays correctly but the subdomains do not. I'm guessing my relative path syntax is wrong. Any help is appreciated. See image below for details. Thanks in advance.

Why isn't my CSS working?

Upvotes: 0

Views: 1277

Answers (1)

BJ Black
BJ Black

Reputation: 2531

Almost for-sure your server is not configured to serve files for the subs from outside their own directory (each sub gets a view of only their little sandbox, not the whole server--this is a good thing for security reasons!). If you can, change your web server to have a /css path for the sub (syntax varies depending on web server).

Alternatively, you can try just creating a symlink (cd sub; ln -s ../css). That may or may not be allowed by your server config, though.

Upvotes: 1

Related Questions