M
M
Maxim Valerievich2015-05-15 22:28:55
Apache HTTP Server
Maxim Valerievich, 2015-05-15 22:28:55

.htaccess How to serve another file even if the file in the request exists on the server?

Hello. Please tell me this thing: it is necessary that all requests for pictures are sent to a php file. There is a rule in htaccess:
RewriteRule .(?:jpe?g|gif|png)$ images.php
So, if we access a picture that is on the server, then the server gives it away, and if you write a fictitious file name, then a redirect to the script occurs. How to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2015-05-16
@S-anches

During the discussion in the comments, it turned out that the reason is that nginx processes the statics and it does not reach Apache. In the case of non-existent files, the request is processed by Apache and therefore the condition is triggered for them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question