views:

27

answers:

1

I have a very very long querystring which ALWAYS starts like this:

  mydomain.com/bincgi/sql_query.php?alot alot alot of variables passed along

What is the regular expression to make a rewriteRule if I want to pass along all the variables but via this link:

  mydomain.com/search/all variables here instead.....

So the last one is what I intend to write as a link, but the "REAL" link is the first one...

Simplified put, I need to replace the /bincgi/sql_query.php with /search/

Hope you understand what I am looking for...

Thanks

A: 

This should work:

RewriteEngine On
RewriteRule ^/?search/?$ bincgi/sql_query.php [QSA,L]

The QSA (query string append) will handle the query string for you, no need to mess with it manually.

Rob
This wont work... When I set the form action to "/search/" instead of "bincgi/sql_query.php" I receive nothing, it is like the page gets refreshed...
Camran
I just edited my answer, you want search/ to rewrite to bincgi/sql_query.php, correct?
Rob
Thanks.........yes thats what I wanted
Camran