CityHost.UA
Help and support

How to return a 503 server response?

To return a header with a 503 response, for example, for cases with technical robots, you can use the following construction:


1. In [the current site directory] , create a directory with the name maintance or any other arbitrary name and specify it as the [site root directory]


2. Create an index.php file inside the directory from point [1] and add the following lines - in order to return the title itself:

 <?php header("HTTP/1.1 503 Service Temporarily Unavailable"); header("Status: 503 Service Temporarily Unavailable"); header("Retry-After: 3600"); ?>

3. Create an .htaccess file inside the directory from point [1] and add the following lines - in order to redirect all requests to index.php:

 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . index.php [L]

For quick access to files, directories and their editing, you can use [file manager]