Pon tu anuncio | Solicitar recogida | Por paises | Por Categorías

Modify HTTP Headers, Examples

// See related links for more status codes
 
// Use this header instruction to fix 404 headers
// produced by url rewriting…
header(‘HTTP/1.1 200 OK’);
 
// Page was not found:
header(‘HTTP/1.1 404 Not Found’);
 
// Access forbidden:
header(‘HTTP/1.1 403 Forbidden’);
 
// The page moved permanently should be used for
// all redrictions, because search engines know
// what’s going on and can easily update their urls.
header(‘HTTP/1.1 301 Moved Permanently’);
 
// Server error
header(‘HTTP/1.1 500 Internal Server Error’);
 
// Redirect to a new location:
header(‘Location: http://www.europegoodbye.com/’);
 
// Redriect with a delay:
header(‘Refresh: 10; url=http://www.europegoodbye.com/’);
print ‘You will be redirected in 10 seconds’;
 
// you can also use the HTML syntax:
// <meta http-equiv=”refresh” content=”10;http://www.europegoodbye.com/ />
 
// override X-Powered-By value
header(‘X-Powered-By: PHP/4.4.0′);
header(‘X-Powered-By: Brain/0.6b’);

 
// content language (en = English)
header(‘Content-language: en’);
 
// last modified (good for caching)
$time = time() – 60; // or filemtime($fn), etc
header(‘Last-Modified: ‘.gmdate(‘D, d M Y H:i:s’, $time).’ GMT’);

 
// header for telling the browser that the content
// did not get changed
header(‘HTTP/1.1 304 Not Modified’);
 
// set content length (good for caching):
header(‘Content-Length: 1234′);
 
// Headers for an download:
header(‘Content-Type: application/octet-stream’);
header(‘Content-Disposition: attachment; filename=”example.zip”‘);
header(‘Content-Transfer-Encoding: binary’);

// load the file to send:
readfile(‘example.zip’);
 
// Disable caching of the current document:
header(‘Cache-Control: no-cache, no-store, max-age=0, must-revalidate’);
header(‘Expires: Mon, 26 Jul 1997 05:00:00 GMT’); // Date in the past
header(‘Pragma: no-cache’);

 
// set content type:
header(‘Content-Type: text/html; charset=iso-8859-1′);
header(‘Content-Type: text/html; charset=utf-8′);
header(‘Content-Type: text/plain’); // plain text file
header(‘Content-Type: image/jpeg’); // JPG picture
header(‘Content-Type: application/zip’); // ZIP file
header(‘Content-Type: application/pdf’); // PDF file
header(‘Content-Type: audio/mpeg’); // Audio MPEG (MP3,…) file
header(‘Content-Type: application/x-shockwave-flash’); // Flash animation

 
// show sign in box
header(‘HTTP/1.1 401 Unauthorized’);
header(‘WWW-Authenticate: Basic realm=”Top Secret”‘);

print ‘Text that will be displayed if the user hits cancel or ‘;
print ‘enters wrong login data’;

El reportage o la galeria seleccionada no dispone de fotos
Comentar

9 Comments.

  1. immense journal you take

  2. I think youve made some really interesting points. Not as well many people would basically think about this the way you just did. Im actually impressed that theres so much about this subject thats been uncovered and you did it so properly, with so considerably class. Good one you, man! Really wonderful stuff here.

  3. Thanks for taking the time to discuss this, I really feel strongly about it and like understanding a lot more on this subject. If achievable, as you acquire knowledge, would you mind updating your weblog with additional info? It is very helpful for me.

  4. Excellent job here. I really enjoyed what you had to say. Keep going because you definitely bring a new voice to this topic. Not many people would say what youve said and still make it interesting. Well, at least Im interested. Cant wait to see a lot more of this from you.

  5. Youre so right. Im there with you. Your blog is absolutely worth a read if anybody comes throughout it. Im lucky I did because now Ive got a whole new view of this. I didnt realise that this issue was so important and so universal. You unquestionably put it in perspective for me.

  6. This was a definitely extremely great submit. In theory I’d like to create like this also – getting time and actual effort to make a wonderful piece of writing… but what can I say… I procrastinate alot and by no means seem to obtain something done.

  7. Sick! Just acquired a brand-new Pearl and I can now read your blog on my phone’s browser, it didn’t work on my aged one.

  8. What I wouldnt give to have a debate with you about this. You just say so many things that come from nowhere that Im fairly positive Id have a fair shot. Your blog is excellent visually, I mean people wont be bored. But others who can see past the videos and the layout wont be so impressed with your generic understanding of this topic.

  9. I admire the beneficial data you offer in your articles. I will bookmark your blog and have my kids examine up here generally. I am very sure they will discover a lot of new things right here than anybody else!

Responder


[ Ctrl + Enter ]