Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

editing the default title for directory views in apache with htaccess

I'm trying to pretty up the default directory view in apache with an htaccess file. I've done pretty much everything I want to do, except change the default verbiage for the title. By default, it says something like:

"Index of [folder_name]"

and if I use this:

# SPECIFY HEADER FILE
HeaderName /apache/header.html

in htaccess, I can include my own header title, which I like because I can add CSS styling and whatnot, but I cannot make the title change with each folder I visit. Is there a way to do this?

like image 938
mheavers Avatar asked Oct 27 '25 21:10

mheavers


1 Answers

I think this is what I was after - http://httpd.apache.org/docs/2.2/env.html

Enter this as the title for your h1 tags: <!--#echo var="REQUEST_URI" --> and save the header with a .shtml tag extension and your titles become dynamic. However, I still would like to be able to change the verbiage - get rid of the "Index of" and maybe have only the current directory show rather than the path to the directory.

like image 122
mheavers Avatar answered Oct 29 '25 17:10

mheavers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!