php-middleware/block-robots

There is no license information available for the latest version (1.1.0) of this package.

PSR-15 middleware to avoid search engine indexing with PSR-7

1.1.0 2017-05-11 22:52 UTC

This package is not auto-updated.

Last update: 2024-03-20 07:40:08 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 with noindex, nofollow value.
  • Add robots.txt "file" with User-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.