httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcos Mendez <marcosrmen...@gmail.com>
Subject Re: [users@httpd] ad-supported apache proxy
Date Tue, 27 Oct 2009 13:39:53 GMT
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 eweek.com,
google.com, or yahoo.com... 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 .myadserver.com myadserver.com 172.16.1.29
        <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>


On Tue, Oct 27, 2009 at 7:25 AM, Mike Cardwell
<apache-users@lists.grepular.com> wrote:
> Marcos Mendez wrote:
>>
>> Thanks for the response. I tried compiling it and ran into issues.
>> However, I am not sure that fundamentally this is the best approach.
>> Replacing or injecting content into the proxied site content will
>> work. I've tried modifying the body, head, html, script tags. It just
>> hasn't worked reliably for me... for example with google.com or
>> yahoo.com. I was wondering if doing an internal redirect, framing the
>> url (so that it renders as normal) and placing my ads outside would be
>> better.
>
> How are you inserting the ads? I would probably approach this by inserting
> the ad immediately after the body tag and setting the position to absolute,
> with a high z-index so it's at the front. I would also add a small icon to
> close the advert in case it causes a problem by hovering over the top of
> important content.
>
> Something like this perhaps (untested)
>
> <body>
>   <div id="my_advert_box"
> style="position:absolute;top:0;right:0;z-index:1000">
>      <a href="#"
> onclick="document.getElementById('my_advert_box').style.display='none';">[X]</a>
>      Advert content
>   </div>
>
> --
> Mike Cardwell - IT Consultant and LAMP developer
> Cardwell IT Ltd. (UK Reg'd Company #06920226) http://cardwellit.com/
> Technical Blog: https://secure.grepular.com/blog/
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message