Solved

Rewrite Cond

Posted on 2006-10-25
7
217 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 500 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
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

729 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