php-middleware / block-robots
PSR-15 middleware to avoid search engine indexing with PSR-7
Installs: 33 237
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: >=5.6
- http-interop/http-middleware: ^0.4.1
- php-middleware/double-pass-compatibility: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- phpunit/phpunit: ^5.7 || ^6.1
- zendframework/zend-diactoros: ^1.1.3
This package is not auto-updated.
Last update: 2024-12-11 11:24:42 UTC
README
PSR-15 middleware to avoid search engine indexing with PSR-7
This middleware provide framework-agnostic possibility to preventing your site from being indexed.
How it works?
- Add
X-Robots-Tag
header withnoindex, nofollow
value. - Add
robots.txt
"file" withUser-Agent: * Disallow: /
body
Installation
composer require php-middleware/block-robots
$blockRobotsMiddleware = new PhpMiddleware\BlockRobots\BlockRobotsMiddleware(); $app = new MiddlewareRunner(); $app->add($blockRobotsMiddleware); $app->run($request, $response);
It's just works with any modern php framework!
Middleware tested on:
Middleware should works with:
And any other modern framework supported middlewares and PSR-7.