C
Crappola 308
Hi everyone,
I have a small problem with my web site and though I'd ask here first. I suspect
it's a fairly common problem, now that I read a bit about it.
All my pages are .html 4.01 pages. Every page on my site has 4 scripts. A js for
StatCounter which counts visitors, a js for a small widget which shows online
visitors, some regular html code for the valid HTML 4.01 tag (that's not
actually js, but the usual html validation referrer code for W3) and a js for
Google analytics. The scripts are distributed like this. Google wants their
script just before </head>.
<html>
<head>
..css
google.js
</head>
<body>
....
statcounter.js
widget.js
w3.html
</body>
I was thinking that maybe it would be a good idea to "extract" all those pieces
of code, put them all in some higher directory and load them dynamically as
includes on every page. I am basically cluless on html, so I searched the net
and found that there are several solutions to this.
The easier seems to be Server Side Includes (SSI), using something like:
<html>
<head>
..css
<--#include virtual="http://www.xxx.com/js/google.html"--->
</head>
<body>
....
<--#include virtual="http://www.xxx.com/js/statcounter.html"--->
<--#include virtual="http://www.xxx.com/js/widget.html"--->
<--#include virtual="http://www.xxx.com/js/w3.html"--->
</body>
It looks elegant, too. BUT: In order to do this, I have to do either:
include a .htaccess file which enables SSI on my domain provider (yahoo
webhosting) for my directories. I tried uploading one such file to my main web
hosting directory, but I got a message saying something like "forbidden, stay in
your directory only". So this is out.
Second solution: Assuming the yahoo host activates SSI with .shhtp (some servers
do?) I could conceivably change all my pages to .shttp, but this is no go,
because the web site has over 250 pages with many links already hardcoded
outside my site. Also, I tried it on one page and it doesn't work. Solutions
which will force me to change the page type are out.
..php solutions also require me to change the type of web pages, so these are
out.
I also tried the following pseudo-include:
<script type="text/javascript"
src="http://www.xxx.com/js/statcounter.html"></script>
Doesn't work either.
The yahoo hosting representatives are fairly clueless about all this. I just
need a simple html include, to eliminate around 250 repeated instances of the
same quadruple code on my web site. Nothing more, nothing less.
Is there a solution for this or am I searching in vain?
Thanks
I have a small problem with my web site and though I'd ask here first. I suspect
it's a fairly common problem, now that I read a bit about it.
All my pages are .html 4.01 pages. Every page on my site has 4 scripts. A js for
StatCounter which counts visitors, a js for a small widget which shows online
visitors, some regular html code for the valid HTML 4.01 tag (that's not
actually js, but the usual html validation referrer code for W3) and a js for
Google analytics. The scripts are distributed like this. Google wants their
script just before </head>.
<html>
<head>
..css
google.js
</head>
<body>
....
statcounter.js
widget.js
w3.html
</body>
I was thinking that maybe it would be a good idea to "extract" all those pieces
of code, put them all in some higher directory and load them dynamically as
includes on every page. I am basically cluless on html, so I searched the net
and found that there are several solutions to this.
The easier seems to be Server Side Includes (SSI), using something like:
<html>
<head>
..css
<--#include virtual="http://www.xxx.com/js/google.html"--->
</head>
<body>
....
<--#include virtual="http://www.xxx.com/js/statcounter.html"--->
<--#include virtual="http://www.xxx.com/js/widget.html"--->
<--#include virtual="http://www.xxx.com/js/w3.html"--->
</body>
It looks elegant, too. BUT: In order to do this, I have to do either:
include a .htaccess file which enables SSI on my domain provider (yahoo
webhosting) for my directories. I tried uploading one such file to my main web
hosting directory, but I got a message saying something like "forbidden, stay in
your directory only". So this is out.
Second solution: Assuming the yahoo host activates SSI with .shhtp (some servers
do?) I could conceivably change all my pages to .shttp, but this is no go,
because the web site has over 250 pages with many links already hardcoded
outside my site. Also, I tried it on one page and it doesn't work. Solutions
which will force me to change the page type are out.
..php solutions also require me to change the type of web pages, so these are
out.
I also tried the following pseudo-include:
<script type="text/javascript"
src="http://www.xxx.com/js/statcounter.html"></script>
Doesn't work either.
The yahoo hosting representatives are fairly clueless about all this. I just
need a simple html include, to eliminate around 250 repeated instances of the
same quadruple code on my web site. Nothing more, nothing less.
Is there a solution for this or am I searching in vain?
Thanks