1 / 6

File non trovato

HTTP/1.1 404 Not Found Date: Tue, 06 Jan 2006 13:40:52 GMT Server: HP Apache-based Web Server/1.3.27 (Unix) mod_perl/1.27 PHP/4.2.2 Transfer-Encoding: chunked Content-Type: text/html a5 <html> <head> <title>404 Not Found</title> <link rel="stylesheet" href="./fonts.css" type="text/css">

zephr-case
Télécharger la présentation

File non trovato

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HTTP/1.1 404 Not Found • Date: Tue, 06 Jan 2006 13:40:52 GMT • Server: HP Apache-based Web Server/1.3.27 (Unix) mod_perl/1.27 PHP/4.2.2 • Transfer-Encoding: chunked • Content-Type: text/html • a5 • <html> • <head> • <title>404 Not Found</title> • <link rel="stylesheet" href="./fonts.css" type="text/css"> • </head> • <body bgcolor="#FFFFFF" text="#000000"> • <h1>Page Not Found</h1> • <p class="text">The requested URL • /~avf/foo.html • was not found on this server.</P> • </body> • </html> • 0 • Connection closed by foreign host. File non trovato • bash-2.05b$ telnet www.myserver.unimi.it 80 • Trying 10.0.64.233... • Connected to www.myserver.unimi.it . • Escape character is '^]'. • GET/~avf/foo.htmlHTTP/1.1 • Host: www.myserver.unimi.it Se il file non viene trovato, la risposta include il codice d’errore 404 e la pagina d’errore generica

  2. Richieste non standard • Il protocollo HTTP comprende un gran numero di tipi di richieste e di possibili risposte. • Non tutte le richieste causano un trasferimento di dati. • In alcuni casi si tratta di informazioni sul server. • Esaminiamo alcuni esempi.

  3. HTTP/1.1 200 OK Date: Tue, 06 Jan 2006 11:45:09 GMT Server: HP Apache-based Web Server/1.3.27 (Unix) mod_perl/1.27 PHP/4.2.2 Last-Modified: Tue, 30 Dec 2005 12:37:03 GMT ETag: "10b3e-1000-431452ef" Accept-Ranges: bytes Content-Length: 4096 Content-Type: text/html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> … </head> <body> <h1>Homepage</h1> … </body> </html> Connection closed by foreign host. URI relative a directory • bash-2.05b$ telnet www.myserver.unimi.it 80 • Trying 10.0.64.233... • Connected to www.myserver.unimi.it. • Escape character is '^]'. • GET/~avf/index.html HTTP/1.1 • Host: www.myserver.unimi.it Se è specificata una directory, il server vi cercherà un file denominato index.html

  4. HTTP/1.1 301Moved Permanently Date: Tue, 06 Jan 2006 13:49:15 GMT Server: HP Apache-based Web Server/1.3.27 (Unix) mod_perl/1.27 PHP/4.2.2 Location: http:// www.myserver.unimi.it /~avf/ Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 148 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>301 Moved Permanently</TITLE> </HEAD><BODY> <H1>Moved Permanently</H1> The document has moved <A HREF="http://www.myserver.unimi.it/~avf/">here</A>.<P> <HR> <ADDRESS>HP Apache-based Web Server/1.3.27 Server at www.myserver.unimi.it Port 80</ADDRESS> </BODY></HTML> 0 Connection closed by foreign host. Reindirizzamento • bash-2.05b$ telnet www.myserver.unimi.it 80 • Trying 10.0.64.233... • Connected to www.myserver.unimi.it. • Escape character is '^]'. • GET/~avfHTTP/1.1 • Host:www.myserver.unimi.it Poiché all’URI manca / alla fine, il browser deve fare 2 richieste

  5. FINE Campi dell’header di richiesta • Il client può specificare ulteriori informazioni nella richiesta. • User-Agent Indica la versione del browser. • Referer Comunica al server da dove proviene l’utente (utile per eseguire il log e per tenere traccia dell’utente). • From Contiene l’indirizzo e-mail dell’utente (generalmente non usato per motivi di privacy). • Authorization Può inviare il nome utente e la password (usato con documenti che richiedono l’autorizzazione). • If-Modified-Since Invia il documento solo se è più recente della data specificata (usato per memorizzare nella cache).

More Related