I have a rewrite rule intended to route the users to my index.php
if they visit my /images/*
directory so that I can route this correctly and check user permissions before displaying the image.
However, the issue here is that when I try to display the image to the user, the call to display the image is being picked up by the RewriteRule too.
Is there a way to ignore the RewriteRule if the file executing is PHP/phtml?
My htaccess
RewriteEngine on
RewriteRule (/)?images/(.*)$ /index.php?request=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?request=$1 [L,QSA]
I'm looking for something like
if the file executing is not a PHP script/being called from the server:
RewriteRule (/)?images/(.*)$ /index.php?request=$1 [L,QSA]