I'm trying to rewrite urls that have an image in them but not 'php', for example:
I want to match this:
http://domain.com/trees.jpg
and rewrite it to this:
http://domain.com/viewimg.php?image=trees.jpg
But not match this:
http://domain.com/index.php?image=trees.jpg
because it has 'php' in it, so it shouldn't do any rewriting at all to that url.
I'm no good with regex but I've been trying a number of variations and none have worked. Here's an example of one variation I've tried:
url.rewrite-once = (
"(?!php\b)\b\w+\.(jpg|jpeg|png|gif)$" => "/viewimg.php?image=$1.$2"
)
Any help would be greatly appreciated, thanks.