L
L
lightalex2019-07-17 23:41:41
Apache HTTP Server
lightalex, 2019-07-17 23:41:41

How to route all requests to a subdirectory?

Good day!
There is a code that should, in theory, route all requests to a subdirectory public:

RewriteEngine On
RewriteRule ^(.*)$ public/$1 [QSA,L]

But the files in the root are still available. And for non-existent files, a 500 error is returned.
Tell me please, what could be the problem?
The idea is that absolutely all requests are routed to the subdirectory public, and also close all files outside this directory for access. But something doesn't go according to plan :)
PS The tests were carried out on beget's hosting.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gip, 2019-07-18
@Giperoglif

and religion does not allow to configure VirtualHost at once in public?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question