Answer the question
In order to leave comments, you need to log in
How to rewrite routings from Apache to Nginx (split into backend\frontend)?
The project is divided into frontend\backend.
The structure is
:
/
/...
/backend/www/...
/backend/www/index.php
/frontend/www/...
/frontend/www/index.php
when we access site.com/css/style.css the actual file is located at /frontend/www/css/style.css, if we access a non-existent file without extension, then the request falls to /frontend/www/index.php , but if the path starts with /admin/* then everything is the same only on the path /backend/www/....
Now everything works under apache, but I would like to get rid of it.
Organized now as follows:
at the root (document_root) is /.htaccess
RewriteEngine on
RewriteRule ^/?admin(.*)$ /backend/www/$1 [L]
RewriteRule (.*) frontend/www/$1 [last]
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png|bmp|css|js).* [NC]
RewriteRule (.*) index.php
Answer the question
In order to leave comments, you need to log in
What's the problem? Read the documentation : location, try_files, rewrite, ... And make up your own configuration. It is better not to look for a ready-made one on the net, because. full of examples with errors.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question