.htaccess RewriteRule only when a string doesn't exist
Posted: Thu Mar 19, 2009 2:27 pm
I am new to regular expressions, so hopefully this is not a stupid question. I am trying to use a .htaccess file with a RewriteRule to identify only file names and/or paths that don't contain the string "thumb_". Right now I have an expression that can find "thumb_" in the provided string, but I need just the opposite. I need to know if string doesn't contain "thumb_". Below is the complete contents of my .htaccess file and I can't figure out how to reverse it. Any thoughts?
RewriteEngine on
RewriteRule ^(.*thumb_.*\.[jJ].*)$ watermark.php?i=$1
I want these to be returned: "img.jpg" and "gallery/img.jpg"
And I don't want these: "thumb_img.jpg" and "gallery/thumb_img.jpg"
RewriteEngine on
RewriteRule ^(.*thumb_.*\.[jJ].*)$ watermark.php?i=$1
I want these to be returned: "img.jpg" and "gallery/img.jpg"
And I don't want these: "thumb_img.jpg" and "gallery/thumb_img.jpg"