Currently my web site shows the same data if people go to domain.com or http://www.domain.com.
I would like to set up a redirect so all requests to domain.com will get sent onto http://www.domain.com. So a user who goes to domain.com will get redirected to http://www.domain.com. Just like what happens if you go to http://amazon.com/?a=b
I don’t want to lose or corrupt any GET or POST data that is sent in the domain.com request.
What is the best way to do this? Should I use a 301 redirect? Will this cause the user’s browser to re-send GET/POST data to the http://www.domain.com URL?
[EDIT] Ok, Zaagmans says redirecting POST transparently to the user is not possible. So lets ignore POST for the moment. How should I redirect with just query string data?
The Redirecting Post Requests article explains this in detail.
A (possible) downside of the proposed 307 redirect is the fact that the browser will alert the user and present an option to proceed or to cancel the request.