4

How to include php file using .htaccess? I google it but i cant find a good tutorial or code.

Here is a php include code :

<?php require('footer.php'); ?>
0

2 Answers 2

7

This code is Prepend the file

php_value auto_prepend_file "/dir/path/utilities.php"

This code is Append file to bottom of the page

php_value auto_append_file "/dir/path/templates/footer.php"

I found this answer in http://samweby.blogspot.in/2013/07/prepend-and-append-htaccess-file.html link.

Sign up to request clarification or add additional context in comments.

Comments

6

You can try auto_append_file, as follows

php_value auto_append_file  "footer.php"

That would have the effect of including footer.php after every PHP script, which I think is what you want? There is also auto_prepend_file, which will include the specified script before each request.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.