F
F
fStrange2019-09-30 14:08:59
htaccess
fStrange, 2019-09-30 14:08:59

How to redirect images from one folder to image.php?

There is a standard htaccess
Files, except for those specified in the exceptions, are processed through index.php

RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.jpeg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

I need images from one separate folder ( generated ) to be processed through image.php
/media/1.jpg - and we ignore it , as it is now in the rule for .htaccess
/blabla - we process it through index.php as it is now in the rule.
/generated/1.jpg - we process through image.php , I want to add this .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-09-30
@fStrange

RewriteRule ^generated/ image.php [L]

RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.jpeg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question