Rewrite Cond


I have this rule...RewriteEngine on
RewriteRule ^([0-9a-zA-Z]+)[_]([0-9a-zA-Z]+)[_]([0-9a-zA-Z]+).*$ results.asp?kwds=$1+$2+$3
RewriteEngine on
RewriteRule ^([0-9a-zA-Z]+)[_]([0-9a-zA-Z]+).*$ results.asp?kwds=$1+$2

The problem is that it affects files like this...tp_general_highlight_on.gif which is an image file - unfortunately - i get this feed from else where so i cannot change the file name. What kind of condition can i set to ignore this file? and how can i set it?

Please help!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HonorGodSoftware EngineerCommented:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !(.*).gif [NC]
RewriteRule ^([0-9a-zA-Z]+)[_]([0-9a-zA-Z]+).*$ results.asp?kwds=$1+$2

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mrperfect75000Author Commented:

That makes sense but it seems to be searching for tp_general first -

i dont think the rule gets to the gif part - it gives me the same thing and seems to be trying to do this...results.asp?kwds=tp%20general...

any ides?
HonorGodSoftware EngineerCommented:
 Well, according to the way the rules are supposed to work, the Cond should occur after the Rule, and thus the transformation should not occur.  Interesting.
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

HonorGodSoftware EngineerCommented:
you might try:

RewriteRule ^([0-9a-zA-Z]+)[_]([0-9a-zA-Z]+)*!(?gif)$ results.asp?kwds=$1+$2
mrperfect75000Author Commented:
It still gives me an Internal Error
An other thing: Do you need .* at the end? Should foo_bar:foo result in results.asp?kwds=foo+bar?


RewriteEngine on
RewriteRule ^([0-9a-z]+)_([0-9a-z]+)$ results.asp?kwds=$1+$2 [NC,L]
RewriteRule ^([0-9a-z]+)_([0-9a-z]+)_([0-9a-z]+)$ results.asp?kwds=$1+$2+$3 [NC,L]

should fix it, too. Don't forget to clear the browser's cache.
HonorGodSoftware EngineerCommented:
Thanks for the 'A'.
Did it resolve your issue?
What was happening that was causing the confusion?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.