Footers to pages served by apache-based server

Footers to pages served by apache-based server

Post by Khetan Gajj » Tue, 05 May 1998 04:00:00



Hi.

I asked this earlier, and have had no response. So, I'll try
again :-(

I've got a Apache 1.2.6 server, and would like all HTML files
served by it to have added to them a HTML footer.

I've looked at mod_trailer.c (but it's very outdated, and causes
the server to SIGSEGV whenever I incorporate it).

I want the solution to be _server_ based, and not HTML
based (ie I don't want to put in a SSI like
<!--include virtual="/footer.html"--> in each and every
document (I've got hundereds, and won't remember to add it
in to every new one I create).

Any pointers/links/help ?

If possible, replies to me, as my newsfeed appears to be
slightly broken.
---


UUNET Internet Africa Support | FreeBSD enthusiast-www2.za.freebsd.org
"Linux replaces Windows. FreeBSD replaces NT."

 
 
 

Footers to pages served by apache-based server

Post by Thomas J. Tark » Tue, 05 May 1998 04:00:00


: I've got a Apache 1.2.6 server, and would like all HTML files
: served by it to have added to them a HTML footer.

Use ApacheSandwich (found in the CPAN directory modules/by-module/Apache/
on any CPAN site (you can get to CPAN from www.perl.com) or, someone
reposted this recently:

Subject:      Re: Adding a footer to pages on server

Date:         1997/04/17

Newsgroups:   comp.infosystems.www.servers.unix
[More Headers]
[Subscribe to comp.infosystems.www.servers.unix]

: Is there a way to add a footer to pages hosted on my server.

Yup. If you have control over the content use a ssi to do it. enable
your
cgi and write your header in perl or something like this:

#!/usr/bin/perl
print("Content-type: text/html\n\n");
print("I'm a freaking footer. Whew.\n");

If yoiu don't have control over the content ie you want to force
footers on
people: (i'm assuming your running apache)

-- access.conf --
<Directory /to/the/docs/>
AddHandler footer-action html htm shtml
Action footer-action /to/the/cgis/footer
</Directory>

-- footer --
#!/usr/bin/perl


require("webcity.lib");

print("Content-type: text/html\n\n");
open(HTML, $ENV{'PATH_TRANSLATED'});
while ($line = <HTML>) {
        if ("\U$line\E" =~ "</BODY>") {
                print(&get_footer());
                print($line);
        } elsif ("\U$line\E" =~ "<BODY") {
                print($line);
                print(&get_header());
        } else {
                print($line);
        }

Quote:}

close(HTML);

(this will actually add a footer and a header)

--
Tommy Tarka                    |                   http://scro.tm/~tommy

************************************************************************
        "Ovaries are the mark of the DEVIL!!!"        - Kojack Sack, BH4

 
 
 

1. Can Apache force a footer/head on all served web pages?

Can Apache be configured to include, for example, a footer (just some
plain html ... a copyright statement and navigation) to every .htm
or .html page it serves without manually inserting a SSI include tag?

I am running SSI, and there is an include at the bottom of
the "corporate template" for web pages, but too many of my users know
just enough HTML to delete the include tag because they don't recognize
it or don't want it.

Ideally, I would also like to be able to force an include on both the
start and the end of all served web pages.  I know that Netscape
FastTrack can be configured to append a footer to every page, but I
really want to A) use Apache, and B) be able to automatically include a
head as well.

Does anyone have any ideas how to do this?  I'm already running PHP, if
that helps at all.

Thank you very much.

Joel

PS: If this message is a repeat, I apologise.  I think deja never
posted the first one.

Sent via Deja.com http://www.deja.com/
Before you buy.

2. AIX 4.1.5 GNU ld TOC overflow with gcc -mminimal-toc

3. KWord: page 1 in footer shows page 1 on all pages

4. Oops in kmem_extra_free_checks with 2.4.19

5. Apache Server - Web pages get served twice ?????

6. modutils-0.99.15 + ftape-1.12c = PROBLEM!

7. Configuring Apache Web Server to serve jsp and servlet pages

8. Sticking with DOS/Windows

9. Apache Server - Web Pages are served twice ???????

10. Append footer to all web pages with Apache 1.3b5?

11. adding a footer to all html pages with apache??

12. Serve pages based on Client

13. Adding a footer to pages on server