On Fri, 02 Jul 2004 13:24:51 GMT, "michaaal" <res0gyio@verizon.net>
wrote:
[color=blue]
>I have two folders in my website...
>
>Folder1 (this is where my #include file is, this is where the style.css is)
>--Folder2
>
>(Folder2 is inside of Folder1)
>
>Folder2 contains a file that has this #include statement...
>
><!--#include file="../include.inc"-->
>
>...obviously the include.inc file is not in the same folder as the HTML
>file.
>
>The problem is, that the include.inc also contains this CSS statment...
>
><link rel="stylesheet" type="text/css" href="style.css" />
>[/color]
[and the for the stylesheet URI is wrong in the resulting document]
One possibility you might like to try is to set an environment
variable in your Apache configuration (assuming you're using Apache)
and reference it in the include file.
You could either choose to store the "base URI" of the site in there,
which would make some very odd-looking comment-within-tag markup, or
just put the entire link element in there, which is also perhaps the
more flexible solution since you can then change this entire element
just by editing your config, and the stylesheet won't have to "live"
in the same place relative to the documents:
In httpd.conf,
SetEnv STYLESHEET_REF <link ... href="/path/to/style.css" />
(include the full link element; I just shortened it to keep the line
length sensible)
then, in your include file,
<!--#echo var="STYLESHEET_REF" -->
the SetEnv directive is provided by the mod_env module, so you'll need
that loaded. You can use it from an .htaccess file if you can't or
would rather not mess with the global server config.
Note that this question isn't really an HTML question! You might get
better answers if you ask in one of the comp.infosystems.
www.servers.*
groups, and state which server you are running.
The above answer could be applied to other servers, but you'll have to
figure out how to set that environment variable yourself.
-Claire