PHP headers Blog

Always handy:

// 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:

// Redriect with a delay:
header('Refresh: 10; url=');
print 'You will be redirected in 10 seconds';

// you can also use the HTML syntax:
// print 'Text that will be displayed if the user hits cancel or ';
print 'enters wrong login data';

Suggestie? Vraag of opmerking? Laat het ons weten!

Plaats hier je bericht

Reacties (0)