Reputation: 2625
I'm trying to run following dummy URL rewrite rule, but every time I'm adding it nothing happens:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)(\.jpg)$ $1
</IfModule>
Is there anything wrong with above rule ?
Upvotes: 0
Views: 65
Reputation: 113
Your rule is pointless - you check in the RewriteCond if file doesn't exists and if so you try make redirect to the not existing file. mod_rewrite is smart enough to prevent that cand of rewriting hell, he is checking if uri after your RewriteRule doesn't changed, and if so he just ignoring this RewriteRule. So your RewriteRule must modify original uri or it will be ignored.
Upvotes: 2