Site maintenance SEO PSR-15 middleware
Clone or download
snapshotpl Merge pull request #3 from php-middleware/refactor
Add psr-15, psr-17, drop psr-7 implementation dependendy, drop php 5.…
Latest commit b01a46b Oct 16, 2018

maintenance Build Status

Site maintenance middleware SEO friendly

How to usage

Create instance of middleware as you want (we use named constructors) and add it to middleware runner.

$date = DateTime::createFromFormat('Y-m-d H:i:s', '2025-11-30 11:12:13');

$middleware = MaintenanceMiddleware::createWithRetryAsDateTime($date, $psr17ResponseFactory);



  • Setup 503 status code,
  • Supports Retry-After header (as seconds or HTTP-date),
  • Supports Redirect header (redirect page after Retry-After time).

More about this SEO practice: How to deal with planned site downtime in Google Webmaster Central Blog.

How to install

Use composer!

composer require php-middleware/maintenance

This package require PSR-17 message factory implementation to return SEO friendly response.