Forum Moderators: coopster & phranque

Message Too Old, No Replies

Server Header Redirect - Pass along Post Variables?

Hard Question

         

ggrot

12:35 am on Feb 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Lets say you had set up some type of program whereby webmasters put some type of form on their website(example - search box) that submits to a page on your site. This form is large enough so that it needs to be sent by POST, not GET. Now, your site has grown in popularity and you want the requests to be handled by multiple servers. You set up DNS for these servers as www1, www2, www3, etc. However, all the HTML code on these third party sites submits to www. You would like to have the www server simply be a redirection server that sends:
header("location: www1.example.com"); (php example)
which is a hard server redirect to a different url. Unfortunately, from what I am reading, POST variables dont get redirected in this transaction, but in my situation I need them to be. Does anyone know of any other workaround that would create a similar effect?

bird

1:07 am on Feb 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



a) Build a reverse proxy as www, that just passes the requests through to www1, www2, etc. in the background.

b) Use round robin DNS. This means that all your servers will answer to www, but each visitor will get the IP address of just one of them at random.

Both methods are commonly used for load balancing. The first is a little more robust, as the proxy can adapt quickly when one of the backend servers goes down. It also makes it easier to generate one global logfile. Whether that load is caused through third-party forms or normal traffic doesn't really matter.

Redirecting POST requests is bad style, because it potentially jeopardizes the visitors privacy. The standards define rules that the browser should actually ask the user what to do in such a case. In practise, most common browsers simply drop the POST data and send a plain GET request to the redirect target.