Name: robots
Owner: Middlewares
Description: PSR-15 middleware to enable/disable the robots of the search engines
Created: 2016-10-05 15:06:56.0
Updated: 2018-02-04 18:53:50.0
Pushed: 2018-01-25 22:04:25.0
Size: 24
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Middleware to enable/disable the robots of the search engines for non-production environment. Adds automatically the header X-Robots-Tag
in all responses and returns a default body for /robots.txt
request.
This package is installable and autoloadable via Composer as middlewares/robots.
oser require middlewares/robots
patcher = new Dispatcher([
new Middlewares\Robots(false)
ponse = $dispatcher->dispatch(new ServerRequest());
$response->getHeaderLine('X-Robots-Tag'); //noindex, nofollow, noarchive
__construct(bool $allow)
Set true
to allow search engines and false
to disallow.
sitemap(string $sitemap)
Optional url of a sitemap file.
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.