Forum Moderators: phranque

Message Too Old, No Replies

Appending a footer to every page of a site

I'm just so lazy :)

         

j4mes

9:33 pm on Aug 29, 2004 (gmt 0)

10+ Year Member



OK, here's what I want to know:

1) How do I append a footer (in this case a link) to every page of a site without doing it the long way?

2) Do Google et al mind links after the

</html>
,

*OR*

3) Can the footer be inserted before the

</html>
?

Thanks.

jdMorgan

11:04 pm on Aug 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



J4mes,

You cannot put anything after the </body> or </html> closing tags if you expect it to be displayed by browsers or indexed by search engines.

What you are probably looking for is SSI (Server-Side Includes). You could also use PHP to do this, but that's a different forum. ;)

In it's simplest form, SSI on a page for use on Apache would look something like this:


<p>Here's my footer!
<br><!--#include virtual="/footer.inc" -->
<p>I hope you liked it!
</body>
</html>

Apache will scan specified pages or page types for SSI includes, keying off the "<!--#" to identify SSI directives. When it finds one like that shown above, it inserts the included content into the response output. Therefore, no client or search engine can tell that the code was included using SSI -- It is part of the page for all intents and purposes.

There are several ways to enable SSI parsing on Apache, each with advantages and disadvantages. I refer you to Apache mod_include [httpd.apache.org] for some background.

Jim

j4mes

3:19 pm on Aug 31, 2004 (gmt 0)

10+ Year Member



Hi Jim,

Thnaks for the response.

I'm fine with SSI, I use it on most of my sites when not working with PHP because I tweak things so much :D

I just wondered if it was possible to add a footer to every page in just a few lines of code, since in this case (not my site btw) there are about 400 pages I need to append to in one go, and it would make my life a little easier if I don't have to go through pasting code into each and every file.

Perhaps instead you know of a bulk find-and-replace programme?

Thanks again,

James.

Receptional Andy

3:23 pm on Aug 31, 2004 (gmt 0)



a bulk find-and-replace programme

BK ReplaceEm [boolean.ca] is very handy and free.