Ao fazer o tipo de redirecionamento que você está fazendo, há apenas um código de resposta HTTP aplicável, a saber, 301 Moved Permanently
. RFC 2616 , o padrão que define o protocolo HTTP, define o código de resposta 301 assim (minha ênfase):
The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the Request-URI to one or more of the new references returned by the server, where possible. This response is cacheable unless indicated otherwise.
The new permanent URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).
If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
Compare isso com um redirecionamento 302 Found
do HTTP, que é usado com muita frequência quando simplesmente configuramos um "redirecionamento" e o qual é definido como (mais uma vez, minha ênfase):
The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.
The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).
If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
Assim, a maneira correta de redirecionamento de HTTP em seu cenário é configurar o servidor da Web para retornar uma resposta 301 indicando o novo local, em vez de uma resposta 302 . Clientes capazes, em seguida, irão armazenar o novo URL e usá-lo para futuras solicitações.