iNET Interactive - Online Advertising Agency
          
FreeWebHostingTalk Forums  
Quick Links
Find a Host » HOST QUOTE | ISPcheck.com
 
 
Go Back   FreeWebHostingTalk > Main Forums > Free Web Hosting Forum > Header through mod_rewrite or mod_layout

Reply
 
Thread Tools
Old 03-06-2005, 08:32 AM   #1
Maxter
Junior Member
 
Join Date: Mar 2005
Posts: 1

Maxter is offline
Question Header through mod_rewrite or mod_layout
Hello,

I want to start a small free hosting site, with ads. I've tried almost 4 hours to make the ads work through mod_layout or mod_rewrite. There were a few threads about this, but they couldn't help me enough.

With mod_rewrite I made the footer, but it didn't work with PHP files. Only with HTML. Here's the code I used:

.htaccess
Code:
RewriteEngine On
RewriteRule ^(.*)\.html$ /footer.php
footer.php
Code:
<?
$filename=$DOCUMENT_ROOT.$REQUEST_URI;
$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo $contents;
echo "<DIV ALIGN='CENTER'><IMG SRC=http://www.maxterhost.com/templates/rk_business/images/rkbusiness_r1_c1.jpg></DIV>";
?>
I tried to change RewriteRule ^(.*)\.html$ /footer.php to RewriteRule ^(.*)\.*$ /footer.php so I can make it work with all files, but I got always Error 500 - Internal Server Error.

How can I make this work with PHP and HTML files? And how can I make it appear at the top of the page?

Any help would be appreciated.

Please note that I have a reseller account. mod_layout and mod_rewrite are installed.

Thank you.
Reply With Quote
Old 06-21-2005, 12:33 AM   #2
hph
Member
 
Join Date: Oct 2004
Posts: 53

hph is offline
Default
try this for php in a .htaccess

f you are using php (ie., php extensions or html is configured to be parse by php) you could use the following in an htaccess.

php_value auto_prepend_file "/path/to/header.php";
php_value auto_append_file "/path/to/footer.php";

That will put those files at the top and bottom of each php file or any file configured to be parsed by php.
__________________
http://hp-h.com The freehost guru
http://www.freehosting.hostrave.com/index.htm
http://hp-h.us/index.htm
http://hostingisfree.com/ cpanel-50m/5gigsbw
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Advertisement:
 
     
 
 
 

Copyright © 2005-2007, FreeWHT.Com. All Rights Reserved.   Advertise on FreeWHT

Related iNET Interactive Sites:
Web Hosting Talk | Hosting Catalog | Hosting Tech | Hot Scripts

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.