Forum Moderators: phranque

Message Too Old, No Replies

auto insert banner ads using apache server

to create free hosting service

         

kermey

12:23 pm on Aug 26, 2004 (gmt 0)

10+ Year Member



I want to start a free hosting company.

Is there any way that i can get an apache server to automaticly include banner ads on my users pages. The pages will be html pages mainly but some php and cgi too.

Can the httpd.conf file do this?

Thanks in advance :)

jdMorgan

3:35 pm on Aug 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The least-intrusive way to do this would be to use a script to serve each page, adding your banner at the top. You'll have to parse each page and then insert SSI code to include your banner after the <head> section of the subscriber's page.

Jim

kermey

11:23 pm on Aug 26, 2004 (gmt 0)

10+ Year Member



Thanks for your reply.

Ive found out since posting this that apches mod_rewrite can do this. In case it helps anyone else:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!include.php
RewriteRule ^(.*) /include.php
</IfModule>