V
V
Vlad Pasechnik2015-09-16 17:50:47
PHP
Vlad Pasechnik, 2015-09-16 17:50:47

How to refer to index.php when there is no image?

Hello.
Tell me what you need to attribute to refer to the index.php file when the image does not exist.
For example, on request site.ru/images/798456754.jpg , picture
A opens on request site.ru/images/6547626645.jpg and there is no such picture, index.php is launched.
Current htaccess

RewriteEngine on
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)
D
Dmitry Novikov, 2015-09-16
@jumper423

as an option - in the 404 error handler (the page that you have now instead of the erroneous address), set the referrer check. if its address ends with jpg/png/gif - put a 301 redirect to index.php.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question