Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Are POST variables accessible to mod_rewrite? I am trying to determine whether or not it is possible to perform a redirect with Apache2.2 and mod_rewrite where the rewrite rule considers the POST variables associated with a request, and uses these values to inform the final destination.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

No.

One of the reasons we have HTTP-POST is to keep application data out of the URL. So using something that by its definition reformats URLs to try to access that data won't work.

mod_rewrite is for turning

www.foo.com/index.php?uglyparameter=bar

into

www.foo.com/bar

So the user doesn't have to hurt their eyes on an ugly URL. Other uses here: Apache Mod Rewrite Guide

share|improve this answer
    
thanks. im actually trying to make a high level decision about where to send the request, based on the content of the post data, but i guess this is not the way to do it. –  e7zkw9120 Sep 26 '09 at 13:17
    
If you have your heart set on routing traffic based on form input, you can use javascript to change the client-side form elements action property on submit. I recommend against this, as it goes against what I mentioned in my first answer. It just makes the most sense to handle an HTTP POST request on the server. –  bpoetz Sep 27 '09 at 15:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.