There is a problem. I have done MVC in PHP, which recognizes / in a line and takes appropriate actions. Now the question arose in working with files (connecting js and css). I created a request in the template files/js/js1.js , which is not there and I see errors that the controller was not found. If you parse the URL, it is logical.

I need to make my router not work on the files folder at all, so that I connect even non-existing files, but as files, and not an attempt to go to the controller.

Thank.

.htaccess:

 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L] 
  • one
    And what's the point of connecting non-existent files? But if you really want it, then RewriteCond to help - Ipatiev

1 answer 1

add RewriteCond %{REQUEST_URI} !^/files/ condition RewriteCond %{REQUEST_URI} !^/files/