httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Cardwell <>
Subject Re: [users@httpd] ad-supported apache proxy
Date Tue, 27 Oct 2009 14:47:46 GMT
Marcos Mendez wrote:

> Hi, I've tried this approach but it doesn't work reliably. I've tried
> replacing the start or end body, html and even head tags as I
> typically use a script hosted on my adserver to serve the ads. So I
> simply replaced the script with your suggestion. This approach does
> work for simple sites (and my script), but go to use it for,
>, or the ad is nowhere to be seen. Am I missing
> something?
> Here's my proxy.conf
> <IfModule mod_proxy.c>
>         <IfModule mod_ssl.c>
>                 SSLEngine on
>                 SSLProxyEngine on
>         </IfModule>
>         ProxyRequests On
>         NoProxy
>         <Proxy *>
>                 AddOutputFilterByType SUBSTITUTE text/html
>                 Substitute "s|<body?([^>]*?)>|<body$1><div
> id=\"my_advert_box\"
> style=\"position:absolute;top:0;right:0;z-index:1000\"><a href=\"#\"
> click=\"document.getElementById('my_advert_box').style.display='none';\">[X]</a>Advert
> content</div>|iq"
>                 Order allow,deny
>                 Allow from all
>         </Proxy>
>         ProxyVia Off
> </IfModule>

When you go to the page through your proxy and look at the html source 
is the div actually being inserted correctly?

I just downloaded the google front page and manually inserted my div. I 
added a background color, some padding and a big red border. You can see 
it here:

All I did on that page was insert the div that you can see immediately 
after the body tag ends.

Looks like it displays properly to me. Although, google could 
technically be doing some clever stuff with javascript to remove 
unexpected html elements, but I doubt it...

Also, could you please avoid top-posting.

Mike Cardwell - IT Consultant and LAMP developer
Cardwell IT Ltd. (UK Reg'd Company #06920226)
Technical Blog:

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message