Ver Mensaje Individual
  #9  
Antiguo 11-07-2007
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.141
Reputación: 36
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Mira tú por dónde de lo que se entera uno:

Cita:
Empezado por función Header de PHP

(Hablando de distintos casos especiales de uso de "Header")

El segundo caso especial es la cabecera "Location:". No solo envía esta cabecera de vuelta al navegador, sino que también devuelve un código de status REDIRECT (302) al navegador a menos que algún código de status 3xx haya sido enviado ya.
Esto quiere decir que acaso podríamos evitarnos:

Cita:
Empezado por yo mismo
Código PHP:
header("HTTP/1.1 301 Moved Permanently"); 
Pero, no es así; debe haber alguna diferencia entre el código 301 y el 302. Ahora bien, aquí está:

Cita:
Redirection 3xx

The codes in this section indicate action to be taken (normally automatically) by the client in order to fulfill the request.

Moved 301

The data requested has been assigned a new URI, the change is permanent. (N.B. this is an optimisation, which must, pragmatically, be included in this definition. Browsers with link editing capabiliy should automatically relink to the new reference, where possible)

The response contains one or more header lines of the form

URI: <url> String CrLf


Which specify alternative addresses for the object in question. The String is an optional comment field. If the response is to indicate a set of variants which each correspond to the requested URI, then the multipart/alternative wrapping may be used to distinguish different sets

Found 302

The data requested actually resides under a different URL, however, the redirection may be altered on occasion (when making links to these kinds of document, the browser should default to using the Udi of the redirection document, but have the option of linking to the final document) as for "Forward".

The response format is the same as for Moved .
__________________
David Esperalta
www.decsoftutils.com

Última edición por dec fecha: 11-07-2007 a las 04:39:24.
Responder Con Cita