0

In a .htaccess file or another server configuration file, is there a way to add content to the start of all requests, for example:

index.html

World!

.htaccess or another server configuration file

# Fake code
addContent("Hello");

And then when you visit index.html you will read

Hello World
0

In .htaccess you can add this

# Prepend the file
php_value auto_prepend_file "/path/to/header.php"

# Append file to bottom of page
php_value auto_append_file "/path/to/footer.php"

If you are the person who has 100% control of the site this may not be a problem, but if others come in later they may tear some hair out trying to work out where the content is coming from

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.