
9th March 2008, 02:50
|
|
Senior Member
|
|
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
|
|
.htaccess include footer
I am not sure if this is the right forum to put this in, but I am trying to use htaccess to put a footer on all sites created on one of my ispconfig servers, howerver, each way I write the htaccess file gives me a 500 error, an error refering to pear, or has no effect on the index.html or index.php Any ideas on that that may work without any major changes to the server?
Quote:
php_value output_buffering 4098
AddType application/x-httpd-php htm
AddType application/x-httpd-php html
php_value auto_append_file footerad.txt
|
Quote:
powered by ISPConfig
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'footerad.txt' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
|
Last edited by grandpagenocide; 9th March 2008 at 03:00.
|

9th March 2008, 03:03
|
|
Senior Member
|
|
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
|
|
i also tried in my htaccess
Quote:
php_value output_buffering 4098
php_value auto_prepend_file 'http://yourlinkhere.com/headerad.php'
AddType application/x-httpd-php htm
AddType application/x-httpd-php html
php_value auto_append_file 'http://yourlinkhere.com/footerad.php'
|
Quote:
Warning: Unknown: URL file-access is disabled in the server configuration in Unknown on line 0
Warning: Unknown: failed to open stream: no suitable wrapper could be found in Unknown on line 0
Fatal error: Unknown: Failed opening required 'http://test.andpower.info/headerad.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
|
|

9th March 2008, 11:37
|
|
Senior Member
|
|
Join Date: Nov 2006
Location: Poland,Włocławek
Posts: 369
Thanks: 22
Thanked 39 Times in 34 Posts
|
|
It's a shame that
php_value auto_prepend_file
and
php_value auto_append_file
work only with php scripts (You can append text files to).
|

9th March 2008, 15:32
|
|
Senior Member
|
|
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
|
|
lesxek, as you see in the second example I used a php header and footer as well. (they need a smiley with a gun to its head for frustration). Is there a way to include a footer in all formats, php, html. htm, etc. If I get this working, I want to set up a module, that turns on and off forced ads for clients.
Last edited by grandpagenocide; 9th March 2008 at 15:46.
|

9th March 2008, 17:26
|
|
Senior Member
|
|
Join Date: Nov 2006
Location: Poland,Włocławek
Posts: 369
Thanks: 22
Thanked 39 Times in 34 Posts
|
|
I'm looking for the same thing.
|

9th March 2008, 17:41
|
|
Senior Member
|
|
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
|
|
If i can figure out how to do this with htaccess I can write the module without a problem. Its just frustrating the hell out of me trying to get htaccess working.
|

9th March 2008, 20:32
|
|
Moderator
|
|
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,010
Thanks: 254
Thanked 134 Times in 120 Posts
|
|
Anything of value about this error in your Apache error log file?
__________________
Never execute code written on a Friday or a Monday.
|

9th March 2008, 20:37
|
|
Senior Member
|
|
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
|
|
nope nothing that matters, I am assuming its with the AllowOverride directive, but i added allowoverride all to the apache directives
Quote:
|
[Sun Mar 09 15:35:42 2008] [alert] [client 24.190.176.116] /var/www/web43/web/.htaccess: php_value not allowed here
|
|

9th March 2008, 21:53
|
|
Senior Member
|
|
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
|
|
Ok, I have the htaccess working in the /*/web folders by adding the AllowOverride Options tag, but now I need either to enable htaccess in the /var/www folder or to find a way for it to create an htaccess file with each new web. Any ideas?
Figured it out:
I created a folder called ads in var/www/ads
placed my footer.php there
and placed a blank.php there
created an htaccess file in /var/www containing
php_value output_buffering 4098
AddType application/x-httpd-php htm
AddType application/x-httpd-php html
php_value auto_append_file '/var/www/ads/footer.php'
I enabled php server wide, as I give all my clients php anyway,
in apache2.conf under the <Directory /var/www/sharedip>...</Directory>
<Directory /var/www>
Options +Includes -Indexes
AllowOverride None
AllowOverride Indexes AuthConfig Limit FileInfo Options
Order allow,deny
Allow from all
<Files ~ "^\.ht">
Deny from all
</Files>
</Directory>
Also add options in the allowoverride in /var/www/*/web and Allow from root in
<Files ~ "^\.ht">
Allow from root
Deny from all
</Files>
to disable the ads on a particular site
create an htaccess file and place it in the web folder of the client
php_value output_buffering 4098
AddType application/x-httpd-php htm
AddType application/x-httpd-php html
php_value auto_append_file '/var/www/ads/blank.php'
Last edited by grandpagenocide; 9th March 2008 at 22:31.
|
|
The Following User Says Thank You to grandpagenocide For This Useful Post:
|
|

9th March 2008, 22:32
|
|
Senior Member
|
|
Join Date: Jun 2007
Location: Brooklyn, NY
Posts: 308
Thanks: 13
Thanked 43 Times in 29 Posts
|
|
ill ask a mod to move this to tips and tricks
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 16:43.
|
Recent comments
10 hours 55 min ago
17 hours 36 min ago
21 hours 27 min ago
23 hours 5 min ago
1 day 7 hours ago
1 day 16 hours ago
1 day 17 hours ago
1 day 21 hours ago
2 days 1 hour ago
2 days 2 hours ago