.htaccess include footer

Discussion in 'Tips/Tricks/Mods' started by grandpagenocide, Mar 9, 2008.

  1. grandpagenocide

    grandpagenocide New Member

    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?
     
    Last edited: Mar 9, 2008
  2. grandpagenocide

    grandpagenocide New Member

    i also tried in my htaccess
     
  3. Leszek

    Leszek Member

    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).
     
  4. grandpagenocide

    grandpagenocide New Member

    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: Mar 9, 2008
  5. Leszek

    Leszek Member

    I'm looking for the same thing.
     
  6. grandpagenocide

    grandpagenocide New Member

    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.
     
  7. edge

    edge Active Member Moderator

    Anything of value about this error in your Apache error log file?
     
  8. grandpagenocide

    grandpagenocide New Member

    nope nothing that matters, I am assuming its with the AllowOverride directive, but i added allowoverride all to the apache directives
     
  9. grandpagenocide

    grandpagenocide New Member

    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: Mar 9, 2008
  10. grandpagenocide

    grandpagenocide New Member

    ill ask a mod to move this to tips and tricks
     
  11. edge

    edge Active Member Moderator

    As requested, I've moved this thread to Tips/Tricks/Mods
     

Share This Page