I have an .htaccess file with the following contents:
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ entryPoint.php [QSA]
</IfModule>
With this, I want all requests to be redirected to the file entryPoint.php
so that it can examine them:
If it's a .png, then it's a "safe" call.
In case of images, I used to output headers, and file_get_contents()
their content. I figured out it's a bit slower than leaving a direct read.
How to prevent this .htaccess from calling entryPoint.php
if there are references for images?
Extra feedback on the code I already have is greatly appreciated!
As I understand you want to process all non-images threw your php file. Right?
If so, then here is what you need:
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !(\.png|\.jpg|\.gif|\.jpeg|\.bmp)$
RewriteRule (.*) entryPoint.php [QSA]
</IfModule>
Remember to add to delete any image extension you want! If I misunderstood,Please tell me to correct my answer!