External CSS above root folder

tillabong

New Member
Messages
60
Reaction score
0
Points
0
hi i've managed to link to my database login which is above my root folder using php. however when i try to do the same for my external css, it doesnt work. is there a way to go about doing this?

thanks.
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
You can't link to any files client-side that aren't publicly available. If you have a file above public_html (or www), you simply cannot link to it. So you'll have to move your css inside public_html.
 

tillabong

New Member
Messages
60
Reaction score
0
Points
0
the databse login file and css are all within the public_html folder.

public_html/mywebsite.com is my root domain

public_html/css is where i put the css files.

the link worked when i used php to get the database login file but didnt work for the css.

im sorry if i didnt explain it clearly in the first place.
 

Anna

I am just me
Staff member
Messages
11,739
Reaction score
579
Points
113
when entering the domain mywebsite.com the folder mywebsite.com is root for that domain. Php files can be placed outside of that root as they are accessed server side. css however is accessed by the end users browser, which can not read anything outside of the root folder for that domain.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Try using

src="http://wheretogoatnight.x10hosting.com/css/mycssfile.css"

as your link to your css file.
 
Last edited:
Top