Web Servers on Unix and Linux - Mod_rewrite: using just one variable from query string and append it

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > August 2004 > Mod_rewrite: using just one variable from query string and append it





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Mod_rewrite: using just one variable from query string and append it
Tom

2004-08-29, 5:49 pm

I've got a problem with mod_rewrite and rewriting key-value pairs.

Some pages link to my page in an abandoned format, like this:
www.url.com/abandoned.cgi?Key1=Val1&Key2=Val2&Key3=Val3

this has to be translated to: (transparent, with external redirect
[R])
www.url.com/new.cgi?Key2=Val2

I need to rewrite only URLs that contain "abandoned.cgi" and have to
get rid of Key1 and Key3.

After studying numerous mod_rewrite threads and tutorials my question:
do i need a RewriteCond to handle this? "[QSA]" or not? Do I need
"[NE]"? How can this be done?

I've tried a lot! Never got it to work correctly. Most of the time the
the values disappeared. I only managed to get the whole query string
over to the new URL but never to extract just this Key2-bit

I'm stuck. Thanks for any hints
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com