S
S
Sirex00112021-04-17 15:13:03
Yii
Sirex0011, 2021-04-17 15:13:03

Why doesn't htaccess open a file when requested?

Hello everyone, tell me what the problem is, let's say there is a web/quberty/2.jpeg file, I go to the host/quberty/2.jpeg link, the site gives out 404 although the rule is

RewriteCond %{REQUEST_URI} !^/(web)
RewriteRule ^assets/(.*)$ /web/assets/$1 [L]
RewriteRule ^css/(.*)$ web/css/$1 [L]
RewriteRule ^js/(.*)$ web/js/$1 [L]
RewriteRule ^images/(.*)$ web/images/$1 [L]
RewriteRule (.*) /web/$1


all htaccess
RewriteEngine On

RewriteCond %{REQUEST_URI} !^/(web)
RewriteRule ^assets/(.*)$ /web/assets/$1 [L]
RewriteRule ^css/(.*)$ web/css/$1 [L]
RewriteRule ^js/(.*)$ web/js/$1 [L]
RewriteRule ^images/(.*)$ web/images/$1 [L]
RewriteRule (.*) /web/$1

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /web/index.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-04-17
@dodo512

RewriteCond %{REQUEST_URI} !^/(web)

This condition is placed beforeRewriteRule (.*) /web/$1
RewriteEngine On

RewriteRule ^assets/(.*)$ /web/assets/$1 [L]
RewriteRule ^css/(.*)$ web/css/$1 [L]
RewriteRule ^js/(.*)$ web/js/$1 [L]
RewriteRule ^images/(.*)$ web/images/$1 [L]

RewriteCond %{REQUEST_URI} !^/(web)
RewriteRule (.*) /web/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /web/index.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question