htaccess

You are currently browsing articles tagged htaccess.

If you want to use Apache’s auto­matic index func­tion­al­ity for dir­ect­or­ies, yet have your own cus­tom mes­sages on those index pages, here’s how you do it. Simply add to the .htac­cess file for the dir­ect­ory (cre­ate it if it doesn’t already exist) the fol­low­ing line:

HeaderName HEADER.html

where HEADER.html is the name of a file that con­tains the HTML markup that you want to include at the top of the page. To add con­tent to the bot­tom of the dir­ect­ory list­ing, use:

ReadmeName FOOTER.html

again, repla­cing FOOTER.html with the file that con­tains your desired markup.

There are tech­nical details I won’t go into here; read them in the Apache doc­u­ment­a­tion. I’ve imple­men­ted it here and I intend to do so for the dir­ect­or­ies on my site soon.

Tags: , ,