.htaccess forcing footers

software development



I want to force footers on my pages. I have looked at some examples: http://www.webpronews.com/webdevelopment/basicdevelopment/wpn-37-20040429HTACCESSWrapperswithPHP.html
however it does not seem to work… any help would be great!

Use “DCOUNTME” promo code when registering and receive up to $85 off! (referer: saygoodbye)


First create the common footer file, name it something like inc_footer.php and store it on your file system. Now you can modify the .htaccess file so that it includes this footer every time. Just add something like this to it:
php_value auto_append_file /localfilepath/inc_footer.php

BC Tech
Team Shocker


I think auto_append_file and auto_prepend_file only work if you run php as an Apache-module. Unfortunately DreamHost just shut off php as an Apache-module in the Control Panel, but there’s still a work-around.

See http://blog.dreamhosters.com/2006/04/11/end-of-php-as-an-apache-module/ for info.

[color=#000000]DreamHost Promo Code[/color]: [color=#CC0000]Save $50[/color] with the promo code DREAMTEAM


I think I can by pass the DH system just because I have custom php installed… and all php goes through my php config.

Use “DCOUNTME” promo code when registering and recieve up to $85 off! (referer: saygoodbye)


Yes and no. Your own PHP installation is running as CGI, so you still can’t use .htaccess. You can use the auto_append_file directive in your own php.ini, but this is a global setting, which means it will affect every site you run under this PHP installation. There’s no good fix for this, I’m afraid, other than using mod_php (which you can still do with the appropriate Apache directive in .htaccess).

If you want useful replies, ask smart questions.


I didn’t even know there was a way to force include via htaccess.
What I ended up doing is creating a footer.inc file and add include (‘footer.inc’) in each of my pages. It forced me to use the php extention earlier than I intended, but now I can play with php more.


I didn’t test it so I don’t know if it’s possible, but I was thinking… and if we use Apache mod_env to set an ENV variable and then fectch it from our scripts? We would have a way to get include paths and so on and have per directory settings…