P
P
pashaxp2015-09-02 17:27:45
Apache HTTP Server
pashaxp, 2015-09-02 17:27:45

How to disable directory listing and redirect at the same time?

There is a rather long link to the image, with slashes, each slash separates the folder of the file system
example.com/bla/blabla/blablabla/image.jpg
And changing the link for example, like this:
example.com/bla/blabla/blablabla
without the disabled directory listing we see the files in the blablabla folder, which is not good.
Applying
Options -Indexes
in the .htaccess of the project and opening the link example.com/bla/blabla/blablabla, we see the standard error 403, forbidden.
How to make it so that when visiting the link example.com/bla/blabla/blablabla , there is a redirect to a custom 404 page, for example, example.com/404.php or to the main example.com? Using standard web server tools, by adding some option to htaccess or to the virtualhost of the web server

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Fedoseev, 2015-09-02
@pashaxp

errordocument directives

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question