logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Use .htaccess to display error on request directory listing
Author
LoganDark



Joined: 11 Jun 2016
Posts: 2
Location: logandarklock@gmail.com

PostPosted: Sat 11 Jun '16 9:32    Post subject: Use .htaccess to display error on request directory listing Reply with quote

Hello, I want to display a 403 page (display, not redirect) when somebody tries to access a directory listing (example: website.com/images with no index.html) but not when they access a file (example: website.com/images/example.png).

How can I go about doing this?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sat 11 Jun '16 18:28    Post subject: Reply with quote

Create the 403 page you want, name it index.html and put it in there.
or
Turn off the Indexes option and it will 403 on it's own.
Back to top
LoganDark



Joined: 11 Jun 2016
Posts: 2
Location: logandarklock@gmail.com

PostPosted: Sat 11 Jun '16 18:30    Post subject: @glsmith Reply with quote

Oh, thanks. I didn't know it would 403 on its own Smile
Back to top


Reply to topic   Topic: Use .htaccess to display error on request directory listing View previous topic :: View next topic
Post new topic   Forum Index -> Apache