Forum Moderators: bakedjake

Message Too Old, No Replies

How do free web hosts force a header/footer in their members page?

         

AthlonInside

7:40 pm on Aug 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You must be familiar to see free web hosts forcing their members page to load a header/footer with banner ads.

How do they do that? What part of the Apache server needs to be configured?

Duckula

7:45 pm on Aug 14, 2003 (gmt 0)

10+ Year Member



Do you want to do that? Make some kind of "dynamical page" system, be it shtml, cgi, php, etc. Then configure Apache to make the scripted page to include the user page and rename (mod_rewrite it) after.

moltar

7:47 pm on Aug 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are expecting lots of traffic then you better recompile it with that feature (you need to write the feature first).

AthlonInside

7:47 pm on Aug 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes I want to do that.

Can you get me into more details (more keywords)? So I could search for more information about the related things.

Duckula

7:55 pm on Aug 14, 2003 (gmt 0)

10+ Year Member



I don't know the recompiling trick moltar mentioned, sounds very nifty anyway.

The sequence I mentioned came from the top of my head, never tried (exactly like that) but should work.

Make first a template on your favorite web scripting engine (php, for example). That template should have your header/footer and some instances of 'include(foo.inc)' or something like that, where foo.inc is the user's editable page. Then, each time foo.inc is edited the results display on the template. It'll depend heavily on how do you pretend to allow the user to edit.

Now, the fun part. You'll need to configure Apache to use the template for every page the user edits. So, if the user creates bar.html, Apache should call template.php?src=bar.html but not display or even allow the public to see that; therefore needing mod_rewrite and some forbids.

littleman

8:13 pm on Aug 14, 2003 (gmt 0)



One simple way to do this would be to have mod_rewrite reroute all .htm¦.html pages to a script that then grabs the page, parses out /<body(.*?)>/i or /<\/body>/i and replace it with you snippet of code with the ad.

bilalak

5:58 am on Aug 15, 2003 (gmt 0)

10+ Year Member



Use .htaccess to send a header and footer for all the html documents in some directory.

Use a special Apache module to parse the html before sending it to the client and add some scripting to each file ( This is the best method)

Use an ISAPI filter to add some code to each html or asp page.

Luck!

AthlonInside

8:23 am on Aug 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds very hard to me! I even thought of implementing it in a CPanel host but now my dreams broke!

bilalak

8:42 am on Aug 15, 2003 (gmt 0)

10+ Year Member



Why not
U can in fact. But you have to forward all your pages to a special php script or perl script that modify the output.