A
A
Alexey2018-10-23 20:41:35
htaccess
Alexey, 2018-10-23 20:41:35

How to set priority for opening http files?

There is a file in the folder /public/js/app.min.jsand a rule in the router at the same address, but if you open the link in the browser http://site.com/public/js/app.min.js, the contents of jsthe file open, although it should go through the router :(
The contents of the file/.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule ^(.*)$ public/$1
</IfModule>

File content/public/.htaccess
AddDefaultCharset utf-8

RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Syomov, 2018-10-23
@kotomyava

Your rewrite does not work, because. the file exists, and in the rewrite conditions it works if the requested file or folder with this name does not exist.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question