I am having a little trouble with mod_rewrite (probably because I think I am
using it for something it was not intended to do). Basically what I want to
accomplish is to redirect the user based on several rules. The problem is,
the rules are based on both the logical path _and_ the query string. I have
successfully redirected using tests on the path (i.e.,
http://www.mysite.com/MY/PATH), but mod_rewrite does not seem to allow me to
test the query string.
I know that by using RewriteCond I can use environment variables, inclduing
QUERY_STRING, as conditions for my test. But, when it comes to the actual
redirection, RewriteRule does not seem to let me run a regex on the query
string (i.e., it is stripped off and held).
The problem with this is that the url that I want to redirect the user to is
going to be coming to me from within the query string. So, if I have a
query string as such:
http://www.mysite.com/redirect?uri=http://www.othersite.com
I want to test if the path is redirect (easy to do), but then for the
substitution I want to use the value in the uri parameter.
I know I can reappend the string using the flag QSA, but I can't seem to
extract values from this string to use in the redirect. I also know I can
simply write a perl module to handle this, but I wanted the speed increase I
can get from C (which is, of course, what mod_rewrite is written in). Any
suggestions?
Jason Simms
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com