A
A
Alexey Konovalov2020-04-19 22:29:40
htaccess
Alexey Konovalov, 2020-04-19 22:29:40

Why doesn't image redirect work?

I'm trying to make a single entry point, and at the same time I want to redirect images to a different address. I got the following code, but for some reason image redirection does not work:

RewriteRule ^uploads/(.+)$                                          https://site.ru/uploads/$1 [QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$  index.php?$1 [QSA]


And at once, if it is possible, I will ask a related question. If this line is present: then redirecting to index.php does not work either. As soon as I remove it, it works. RewriteCond %{REQUEST_FILENAME} !-d

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-04-19
@Alk90

RewriteRule ^uploads/(.+)$                 https://site.ru/uploads/$1 [QSA]

Replaced by:
RewriteRule ^(uploads/.+)$ https://site.ru/$1 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question