Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
share|improve this question
    
What have you tried? Have you read 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? –  purpler 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 <Directory> 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 Answer 1

up vote 4 down vote accepted

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!)

share|improve this answer
    
yes, that worked :) Thank you Jenny! –  purpler Jan 30 '13 at 11:47
    
You're welcome; the difference between relative and absolute paths has bitten me in the posterior several times :-) –  Jenny D Jan 30 '13 at 12:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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