Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you set, or where is, the local document root?

When opening a file from your hard drive into your browser, where is the document root? To illustrate, given the following HTML code, if the page is opened from the local machine (file:///) then where should the css file be for the browser to find it?

<link href="/temp/test.css" rel="stylesheet" type="text/css" />
like image 229
Adam J.R. Erickson Avatar asked Aug 20 '08 21:08

Adam J.R. Erickson


1 Answers

You can, but probably don't want to, set the document root on a per-file basis in the head of your file:

<base href="my-root">
like image 193
bstark Avatar answered Oct 21 '22 12:10

bstark