I'm using the following in my .htaccess file:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule \.(png|jpg|gif|jpeg|bmp|js|css|map)$ - [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [NC,L,QSA]
My index.php file contains just the following:
<?php mail('me@mydomain.co.uk','Triggered','It was triggered'); ?>
I also have an image in the root directory "test.jpg"
The problem I'm having is that even though the .htaccess should be stopping when it gets one of the matched extensions (because of the L flag), it doesn't.
I know this because each time I access the image, even though the image displays correctly, it's also hitting my index file each time and I'm getting the mail through to my inbox.
Have I done something incorrectly in my .htaccess file?