I have a static web pages protected by apache basic auth. It is not allowing users to logout.
I would like to protect all pages using simple database and cookie based authorization using php sessions and keep apache basic auth as well.
So to do that I need to add to each html file login.php to manage login/logout process.
How to configure apache to add th following text to each html file < ?php include login.php开发者_StackOverflow? >
The reason to do this using apache that I dont want to touch or add any code to the plain html files,the editors are generating only htmls.
Thank you beforehand
Arman
EDIT:
using Marks suggestion solves my problem, in .htaccess file:
# HTACCESS CODE BEGIN
php_value auto_prepend_file "full_path_to_the_include_directory/prepend.php"
php_value auto_append_file "full_path_to_the_file_containing_your_analytics_code"
# HTACCESS CODE ENDS
taken from: weberdev
Set auto_prepend_file=login.php in your php.ini file, or you can set the auto_prepend_file value as a directive in .htaccess or your hosts section of httpd.conf
精彩评论