Modifying .htaccess to make auto-index directories look more like site

They have: 68 posts

Joined: Jun 2006

Hey,

I'm working on making the apache-generated directory listings (see picture below) look more like my site. I've found a couple articles on the subject.. but am unfamiliar with altering the .htaccess file and putting in the new commands.

[IMHey,

I'm working on making the apache-generated directory listings (see picture below) look more like my site. I've found a couple articles on the subject.. but am unfamiliar with altering the .htaccess file and putting in the new commands.

This article: http://www.webpronews.com/expertarticles/expertarticles/wpn-62-20060220ModifyinganAutoIndexedFileListtoMatchyourSitesDesign.html

Tells me to input commands into the .htaccess file.. such as these:

Options Indexes
   IndexOptions FancyIndexing SuppressDescription SuppressHTMLPreamble
   HeaderName header.html
   ReadmeName footer.html
   IndexIgnore header.html footer.html .htaccess
'

What i'm confused about is how to exactly do this.

My .htaccess file reads like this:

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.foothillsbaptist.org
AuthUserFile
/home/footh4/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/footh4/public_html/_vti_pvt/service.grp

Options Indexes
   IndexOptions FancyIndexing SuppressDescription SuppressHTMLPreamble
   HeaderName header.htm
   ReadmeName footer.htm
   IndexIgnore header.htm footer.htm .htaccess
'

I uploaded the new .htaccess in both binary and ascii.. neither worked. I added a header.htm and footer.htm in the same directory with nothing but a different background color (hopefully just enough to change the presentation so that i know it's working).

Unfortuntately, no change occured.

Can anyone help?

Thanks.

Busy's picture

He has: 6,151 posts

Joined: May 2001

order deny,allow
deny from all
allow from all

is wrong, you need to remove one of the rules, either deny or allow, can't do both

try add
Options +FollowSymlinks
to the top of your .htaccess file

can you access the .htaccess file directly? you aren't stopping people viewing it in the code above but when I tried view it (via url in code) I got a 403 error (forbidden) so something is set somewhere.
Make sure your .htaccess is named properly, some editors change the name to htaccess.txt

They have: 68 posts

Joined: Jun 2006

I was able to get it to work. Thanks very much.

The one follow-up question i have... is how to make one .htaccess file filter its style into all sub-directories. Currently, i have to have copies of my header.htm/footer.htm/.htaccess in every directory.. or else the style doesn't effect it.

Here's my code again:

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.foothillsbaptist.org
AuthUserFile
/home/footh4/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/footh4/public_html/_vti_pvt/service.grp
Options +Indexes
   IndexOptions FancyIndexing SuppressDescription SuppressHTMLPreamble
   HeaderName header.htm
   ReadmeName footer.htm
   IndexIgnore header.htm footer.htm .htaccess
suPHP_ConfigPath /home/footh4/public_html
'

If you have any ideas, it'd be much appreciated.

Thanks.

Busy's picture

He has: 6,151 posts

Joined: May 2001

try
./header.htm
./footer.htm

or depending how deep your going just the slash which will take it out to the main

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.