I have a .htaccess file in my root directory. It’s this :
RewriteEngine On
RewriteRule ^(.+) index.php?url=$1 [QSA,L]
In my index.php file I tried to do the following :
<img src="myimage.png"/>
The image wasn’t loaded, however. When I delete the .htaccess file and refresh the page the image comes back.
So what’s the problem here ??
The image is also matched by the expression so its also redirected to index.php. You could try to exclude images by using a rewrite condition for extention.
Another option is to use a condition that excludes files that exist
And directories that exists