D
D
Dmitry Baskakov2021-04-24 14:34:45
htaccess
Dmitry Baskakov, 2021-04-24 14:34:45

How to implement separation of back / front requests through htaccess according to the corresponding directories?

There are 2 directories:
- build
- backend It is

necessary to configure via htaccess (for hosting) that all requests, except for "/api" go to the build directory, and the rest to the backend.

How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-04-24
@dmitrybascacov

RewriteEngine on

RewriteRule ^api /backend/index.php [L]

RewriteCond %{REQUEST_URI} !^/(backend|build)/
RewriteRule .* /build/$0 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /build/index.php [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question