For the site I need to do the following:
- from url of the form
http://site.name/static/***it is necessary to removestatic, that is,http://site.name/static/css/styles.cssshould be read ashttp://site.name/css/styles.css - URL
http://site.name/api,http://site.name/staticandhttp://site.name/adminto issue files located in the respective folders:api,static,admin; - all other requests are redirected to
http://site.name/index.html.
For now, I do it like this:
RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/static%{REQUEST_URI} -f RewriteRule ^(.+) /static/$1 [L] RewriteCond %{REQUEST_URI} !^/api/ RewriteCond %{REQUEST_URI} !^/admin/ RewriteCond %{REQUEST_URI} !^/static/ RewriteRule .*? static/index.html However, if you make a request to, for example, http://site.name/css/test.css , but this file does not exist, then http://site.name/index.html opens, instead of issuing an error 404 , although it should . That is, I need to get errors from the static folder 404, 403 , etc. + static c url must be removed.
How can I do it? How many options did not try, it still does not work. Help me please.