I have a website at http://myserver/project1
.
'myserver' is a Windows Server 2003 server with IIS6.
'project1' is a virtual directory (the physical path of which is C:\myprojects\project1
.
I have read that the best way to link to an external stylesheet (for example) is to use a forward slash, e.g. <link href="/style.css">
, as I would also like to link to this stylesheet from a subfolder of the virtual directory.
I would expect this to look for the css file in http://myserver/project1/
, but it seems to be looking in http://myserver/
. I know this because typing <link href="/project1/style.css">
works.
I am guessing it's normal for http://myserver/
to be considered the 'website root' as this is the 'Default Website' (in IIS terms). What I would like to know is if there a way to (either via IIS or PHP) to change this so that I can write paths in the format /style.css
and have the virtual directory find them.
Many thanks