Solved

Rewrite Cond

Posted on 2006-10-25
7
216 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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