verbb / patrol

Easy Maintenance Mode and Smart HTTPS Routing for Craft CMS
MIT License
29 stars 8 forks source link

Feature Request: Define HTTP Status Code for Maintenance Page #1

Closed darnux closed 6 years ago

darnux commented 7 years ago

Would be great if it were possible to set HTTP Status Code (e.g. HTTP 503) for redirects to maintenance pages due to SEO/SearchEngine reasons.

selvinortiz commented 7 years ago

@darnux I'm adding this to the queue, will add it soon.

selvinortiz commented 6 years ago

@darnux I'll be adding support for this on the next release I have planned before submitting Patrol to the plugin store.

selvinortiz commented 6 years ago

@darnux You can now do this in the latest release of Patrol https://github.com/selvinortiz/craft-plugin-patrol/releases/tag/3.1.0

However, rather the controlling the redirect status, you control the response status.

You can set maintenanceModePageUrl to null and set maintenanceModeResponseStatusCode to 505. You would then just make sure that you have 503.html in your templates if you wan to show the user something, rather than a plain server error.