Forum Moderators: phranque

Message Too Old, No Replies

Apache module for inserting AdSense code

insert javascript below <body> at virtual host level

         

alexa

7:23 am on Dec 23, 2003 (gmt 0)



Got a Google AdSense account (just a few lines of javascript code) and want to place it on each and every html pages, some static and some dynamic.

Don't want to touch/change existing web applications.

Instead I want to have a simple Apache module that automatically does this -- insert the AdSense javascript code right after the <BODY> tag for each and every html access -- at run time.

mod_layout (http://software.tangent.org/faqs/mod_layout.html#_1_3) has more than what I need. Too complicated.

mod_mocrify (http://mocrify.netandweb.de/) is also too much.

For performance and maintenance reasons, I want an extremely simple and neat module just for this simple task. The module is better not to have any file/disk operation (except initialization). I want to hold the 100 bytes Google code in memory.

Any suggestion? Thanks.

bakedjake

7:13 pm on Dec 24, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Yes - use mod_layout. It's designed to do exactly what you want to do, and do it easily. :)

It's cake to setup. Really.

BTW - Welcome to WebmasterWorld!