Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
I set the site in "maintenance mode" in the admin-pages with KK's solution https://www.couchcms.com/forum/viewtopic.php?f=8&t=12904&p=36680&hilit=Put+Site+Offline#p36680

and this works perfect, However, i really would like to be able to modify the resuting Maintenance Mode-page.

As i understand it (read somewhere on the forum but cannot find it again), i would be able to add my own maintenance-page by creating a file called 503.php

like this:

Code: Select all
<?php
header("HTTP/1.1 503 Service Temporarily Unavailable");
header("Status: 503 Service Temporarily Unavailable");
header("Retry-After: 3600");
?>
<!DOCTYPE html>
<html>
<head>
<title>Site is temporarily unavailable due to maintenance</title>
</head>
<body>
<h1>Site is temporarily unavailable due to maintenance</h1>
<p>We expect to have the site back up within 4 hours.</p>
</body>
</html>


Or even better, would be if one could add Couchcms code to be able to set the text from within the admin and also the "expected finish-time".

I cannot seem to get this to work on my local MAMP-development site though. The 503.php page is always beeing ignored. I have added it to the .htaccess-file like the other pages (i don't know if this is correct though)

Please help!

Edit: I found the solution! :D

It was easy with this wonderful cms. I read about theming and then it was just to

1. copy site_offline.html to the /theme/sample-directory and
2. edit it as i want my maintenance-mode to appear
3.edit couch/config.php and uncomment //define( 'K_ADMIN_THEME', 'sample' );

Edit: The only question left is:

I assume that the solution by @KK putting site offline from the admin panel won't send any 503's?

How can i send the 503-header in my themed site_offline.html? Can i add PHP-code in the beginning of the page??
I assume that the solution by @KK putting site offline from the admin panel won't send any 503's?

Actually it would. Also, placing a separate 503.php file should also work and automatically send this header (sometimes this file doesn't work on localhosts but this shouldn't be a problem on proper hosting).

Only thing to keep in mind is that this 503 page is shown only to normal visitors (i.e. admins are always exempted).
Thank you for your answer!

It must be my local environment then that doesn't care about the 503-page. I will try live on the host on a not so busy time and see!
3 posts Page 1 of 1