Reputation: 5379
I have an auto-watermarking script on my website, and the .htaccess file uses this line to redirect all images to the watermark.php file, which watermarks them. That I all have working, except the .htaccess line also redirects things like .js. So now my jQuery doesn't work anymore. The line is this:
RewriteRule ^([^thumb].*\.[jJ].*)$ watermark.php?src=$1
I didn't write it, I copied it from somewhere. I think it has to do with the jJ (for .js), but how can I change that to still work with images, but not JS files?
Upvotes: 2
Views: 575
Reputation: 141887
The above regex matches any file whose extension begins with j or J, and whose filename doesn't consist entirely of t
's h
's u
's m
's and b
's. Not exactly what they were going for I don't think.
RewriteRule ^(.*\.(?:jpe?g|bmp|gif|png|tiff?))$ watermark.php?src=$1
will rewrite anything with the extension:
Upvotes: 5