Forum Moderators: phranque

Message Too Old, No Replies

Problem: RewriteRule to exclude images

I'm searching a RewriteRule to exclude images from my other rule

         

bubblegum

3:18 am on Nov 27, 2003 (gmt 0)



I've the folowing rule (RewriteEngine):

RewriteRule index/(.*)$ index.php?link=$1

as result (e.g.):
[my-domain.com...]
The page is located on the server at
[my-domain.com...]
All images are also affected from this rule and have the URL
[my-domain.com...]

I want to exclude all images from this rule to have a 'clear' link for all images (e.g.):
[my-domain.com...]

Do someone now a solution?
Thanks for reply.

Greets from the rainy Berlin.
Oliver

jdMorgan

3:52 am on Nov 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oliver,

Welcome to WebmasterWorld [webmasterworld.com]!

Just add a condition to the rule to exclude anything that ends with ".jpg"


RewriteCond %{REQUEST_URI} !\.jpg$
RewriteRule index/(.*)$ index.php?link=$1

Introduction to mod_rewrite [webmasterworld.com]

Jim