1

I'd like Apache index pages to show my company banner w/ link to homepage on top.

Instead of:

Index of /pub/something

to show

[Company Banner]
Index of /pub/something

I added these lines to .htaccess:

HeaderName HEADER.html 
ReadmeName README.html 

and edited HEADER.html to include banner with link but that banner is only shown to /pub and not /pub/dir pages.

THis is what i currently have in .htaccess:

Options +Indexes
HeaderName HEADER.html
ReadmeName README.html
dzhi
  • 770
  • 3
  • 10
  • 23
  • What have you tried? Have you read http://httpd.apache.org/docs/current/mod/mod_autoindex.html? – Sven Jan 30 '13 at 10:22
  • I added these lines to .htaccess: `HeaderName HEADER.html ReadmeName README.html` and edited HEADER.html to include banner with link but that banner is only shown to /pub and not /pub/dir pages. Any suggestion re this? – dzhi Jan 30 '13 at 10:57
  • In the future, please add such information via an edit to the question, not a comment. That's what the `edit` button is for :) – Sven Jan 30 '13 at 11:11
  • 1
    Did you by any chance add those lines within a context? It'd probably be easier to help you if you could post the whole .htaccess file. – Jenny D Jan 30 '13 at 11:34

1 Answers1

5

I think I've got it.

You're using a relative path to your HEADER.html and your Readme.html. That makes Apache look for the files within whatever directory you're in.

Instead, the lines should (presumably) read something like this:

HeaderName /pub/HEADER.html
ReadmeName /pub/README.html

(of course, replace "pub" with whatever directory the files are actually in!)

Jenny D
  • 27,358
  • 21
  • 74
  • 110
  • Note to others: The directory is the URL from the browser's point of view, not from the server's operating system's POV. – Andrew Jan 25 '20 at 18:46