I have this .htaccess:

RewriteEngine on RewriteRule ^api/(.+) /site/$1 [L] RewriteCond %{DOCUMENT_ROOT}/site/angular%{REQUEST_URI} -f RewriteRule ^(.+) /site/angular/$1 [L] RewriteCond %{REQUEST_URI} !^/api/ RewriteCond %{REQUEST_URI} !^/admin/ RewriteCond %{REQUEST_URI} !^/static/ RewriteCond %{REQUEST_URI} !^/angular/ RewriteCond %{REQUEST_URI} !^/vendor/ RewriteCond %{REQUEST_URI} !^/controllers/ RewriteCond %{REQUEST_URI} !^/css/ RewriteCond %{REQUEST_URI} !^/js/ RewriteCond %{REQUEST_URI} !^/directives/ RewriteCond %{REQUEST_URI} !^/img/ RewriteCond %{REQUEST_URI} !^/modules/ RewriteCond %{REQUEST_URI} !^/services/ RewriteCond %{REQUEST_URI} !^/style/ RewriteCond %{REQUEST_URI} !^/views/ RewriteRule .*? site/angular/index.php 

Website on angularj + api + php page.

api - reads the folder /site/api/ - here the api project. All statics in the /site/angular/ folder. The remaining requests are included in site/angular/index.php

But there is also an admin and a bunch of directories that you need to give access directly.

The problem is that the key [L] does not work after

 RewriteCond %{DOCUMENT_ROOT}/site/angular%{REQUEST_URI} -f RewriteRule ^(.+) /site/angular/$1 [L] 

that is, if I request the file /directives/directive_name.js the request still goes to site/angular/index.php

What is wrong here? on one server it works, on the local one it works, but when it is transferred to another server, the [L] key does not work.

  • Is the file requested exactly transferred? and write on which server it works and which one it does not. if somewhere it works and somewhere it doesn't, then it’s about the server and its settings, not .htaccess. - teran
  • Just moved everything as it was. this is possibly a server problem, but how can the server affect the [L] key? The rest of the .htaccess rules all work. - Ivan Turcan

0