O
O
olezhenka2017-11-16 17:23:34
Apache HTTP Server
olezhenka, 2017-11-16 17:23:34

If there are no index files in the directory - redirect to the main file?

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule (.*) load.php [L]

Here is the code I have and it redirects all requests that go to the directory to the main file.
I need to make sure that if there is an index file in this directory, then load it, and not the main file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maiskiykot, 2018-03-07
@maiskiykot

If there is no index in the directory, then the server returns an error 403. Maybe it makes sense to change the directive to ErrorDocument 403 and open it with the index file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question