Answer the question
In order to leave comments, you need to log in
How to redirect to a 404 error page?
There is a server, installed apache. I want to set up the following:
When I enter a URL where there is no index file, I don't want it to open the directory of all files.
Please tell me what needs to be edited so that it redirects to the page with an error.
Change something in .htaccess and this file should be in www/html root? Or change the file in the apache module itself?
Answer the question
In order to leave comments, you need to log in
It can be in "httpd.conf", or it can be in ".htaccess". The "Indexes" option is responsible for hiding the directory:
Options -Indexes
After setting it with a minus prefix, if there is no index file, a 403 error will be returned.
The error page can be specified like this:
ErrorDocument 403 /your_403_page.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question