Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: Use .htaccess to display error on request directory listing |
|
Author |
|
LoganDark
Joined: 11 Jun 2016 Posts: 2 Location: logandarklock@gmail.com
|
Posted: Sat 11 Jun '16 9:32 Post subject: Use .htaccess to display error on request directory listing |
|
|
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
|
Posted: Sat 11 Jun '16 18:28 Post subject: |
|
|
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
|
Posted: Sat 11 Jun '16 18:30 Post subject: @glsmith |
|
|
Oh, thanks. I didn't know it would 403 on its own |
|
Back to top |
|
|
|
|
|
|