add header to all pages with htaccess?
Moderator: General Moderators
add header to all pages with htaccess?
Is it possible to add a header to all pages with the use of a htaccess script?
Thanks
Hans
Thanks
Hans
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
You should have been more specific about what you want. When you use the word "header", most people will associate this with "HTPP Header".hanzo wrote:thanks but can you give me an example how to add by example header.html to every page because I don't understand alot of it![]()
Thanks
What you want, is a piece of HTML code that is prepended to your page.
In your .htaccess file, include this:
Code: Select all
php_value auto_prepend_file /full/path/to/file.html- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
To put it simply:raghavan20 wrote:I am just now learning apache so I do not really understand the difference between running PHP and running it as a PHP module. Do you mind explaining the same?
- If you run PHP as a CGI binary, Apache basically redirects all requests of PHP files to an executable which then processes the request.
There are several security considerations associated with this.
- If you run PHP as an Apache module, then the PHP interpreter runs as a "sub-program" of Apache.
It consequently inherits Apache's permissions and settings. This means that the PHP interpreter can cooperate with Apache on a certain level (hence the .htaccess command mentioned earlier). However, there are also some exploits possible when PHP is run as a module.
An article with a couple of interesting links (explaing difference between running php as module and cgi)
http://www.sitepoint.com/blogs/2006/01/ ... n-why-php/
http://www.sitepoint.com/blogs/2006/01/ ... n-why-php/
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia