[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Rewrite Cond

Posted on 2006-10-25
7
Medium Priority
?
220 Views
Last Modified: 2010-05-18
Hi,

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!
0
Comment
Question by:mrperfect75000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 41

Accepted Solution

by:
HonorGod earned 2000 total points
ID: 17808935
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !(.*).gif [NC]
RewriteRule ^([0-9a-zA-Z]+)[_]([0-9a-zA-Z]+).*$ results.asp?kwds=$1+$2
0
 

Author Comment

by:mrperfect75000
ID: 17809186

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?
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 17814370
 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.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 41

Expert Comment

by:HonorGod
ID: 17814397
you might try:

RewriteRule ^([0-9a-zA-Z]+)[_]([0-9a-zA-Z]+)*!(?gif)$ results.asp?kwds=$1+$2
0
 

Author Comment

by:mrperfect75000
ID: 17864231
It still gives me an Internal Error
0
 
LVL 27

Expert Comment

by:caterham_www
ID: 17966849
An other thing: Do you need .* at the end? Should foo_bar:foo result in results.asp?kwds=foo+bar?

Otherwise

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.
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 18387701
Thanks for the 'A'.
Did it resolve your issue?
What was happening that was causing the confusion?
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question