How do I make php page return a 503 error (or anything non-200) [duplicate]

Use PHP’s header function to send the code (along with the HTTP version and any other headers you need). More complete info:

When to send HTTP status code?

http://php.net/manual/en/function.header.php

http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 300');//300 seconds

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)