Skip to content

Commit 148f9be

Browse files
committed
Add README
1 parent 656c073 commit 148f9be

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
1-
# block-robots [![Build Status](https://travis-ci.org/php-middleware/block-robots.svg)](https://travis-ci.org/php-middleware/block-robots)
1+
# block-robots middleware [![Build Status](https://travis-ci.org/php-middleware/block-robots.svg)](https://travis-ci.org/php-middleware/block-robots)
22
Middleware to avoid search engine indexing
3+
4+
This middleware provide framework-agnostic possibility to preventing your site from being indexed.
5+
6+
## How it works?
7+
8+
* Add `X-Robots-Tag` with `noindex, nofollow` value.
9+
* Add `robots.txt` with `Disallow: /` body
10+
11+
## Installation
12+
13+
```json
14+
{
15+
"require": {
16+
"php-middleware/block-robots": "^1.0.0"
17+
}
18+
}
19+
```
20+
21+
```php
22+
$blockRobotsMiddleware = new PhpMiddleware\BlockRobots\BlockRobotsMiddleware();
23+
24+
$app = new MiddlewareRunner();
25+
$app->add($blockRobotsMiddleware);
26+
$app->run($request, $response);
27+
```
28+
29+
## It's just works with any modern php framework!
30+
31+
Middleware tested on:
32+
* [Expressive](https://github.com/zendframework/zend-expressive)
33+
34+
Middleware should works with:
35+
* [Slim 3.x](https://github.com/slimphp/Slim)
36+
37+
And any other modern framework [supported middlewares and PSR-7](https://mwop.net/blog/2015-01-08-on-http-middleware-and-psr-7.html).

0 commit comments

Comments
 (0)