I am running Apache on Windows. My DocumentRoot is: C:/apache/web sites The site is at: C:/apache/web sites/mysite/index.php In index.php there is a common include file (header.php) with a stylesheet link as follows: <link rel="stylesheet" type="text/css" href="styles.css" /> So far so good. But I have a directory within "mysite": C:/apache/web sites/mysite/advertising/index.php Again in index.php there is the include file, but obviously the style sheet reference is pointing to the current folder. I tried changing the path of the stylesheet link to "/styles.css" and "../styles.css" but this obviously will give the root file an invalid path. How can I satisfy both conditions? Do I have to specify a RewriteBase or something?
Just use the absolute URL path to the stylesheet. No need to mess with rewriting paths. <link rel="stylesheet" type="text/css" href="http://yoursite.com/styles.css" /> Code (markup):