Mobile app version of vmapp.org
Login or Join
Hamm4606531

: Add content to start of all requests 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

@Hamm4606531

Posted in: #Configuration #Htaccess #Html

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

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Hamm4606531

1 Comments

Sorted by latest first Latest Oldest Best

 

@Pierce454

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme