In my .htaccess file I have this rewrite rule:RewriteRule example actual-page.php [L]
Which simply rewrites:
www.mysite.com/example to www.mysite.com/actual-page.php
The issue I’m having causes images with example in the file name (my_example.png), to not load due to the confusion with the rule.
I’ve fixed my problem by changing the rule to:RewriteRule /example /actual-page.php [L]
I just want to know what the correct solution to this would be. I still have a lot to learn in the world of mod_rewrite, and I want to know if there’s some implemented fix to this kind of issue, or if you really are just supposed to make the rule more specific.
Prepend your rule with this line:
It means that the following rule will only match if the requested url isn’t a real file.