File tree Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change 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 )
2
2
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 ) .
You can’t perform that action at this time.
0 commit comments