Skip to content

[READ ONLY] Subtree split of the snicco/no-robots-middleware package (see snicco/snicco).

License

Notifications You must be signed in to change notification settings

snicco/no-robots-middleware

Repository files navigation

Middleware for snicco/http-routing to disallow search engines

codecov Psalm Type-Coverage Psalm level PhpMetrics - Static Analysis PHP-Versions

This middleware for the snicco/http-routing component allows you to discourage search-engines from indexing the current request path by using the X-Robots-Tag header.

Installation

composer require snicco/no-robots-middleware

Usage

This middleware can be added globally, in a group or on a per-route basis. Choose what works best for you.

use Snicco\Middleware\NoRobots\NoRobots;

// Disallows robots entirely (noindex,no archive,nofollow)
$configurator->get('route1', '/route1', SomeController::class)
              ->middleware(NoRobots::class);

// noindex, no archive, nofollow header is not added because its set to false.
$configurator->get('route1', '/route1', SomeController::class)
              ->middleware(NoRobots::class. ':true,false,true');

Contributing

This repository is a read-only split of the development repo of the Snicco project.

This is how you can contribute.

Reporting issues and sending pull requests

Please report issues in the Snicco monorepo.

Security

If you discover a security vulnerability, please follow our disclosure procedure.

About

[READ ONLY] Subtree split of the snicco/no-robots-middleware package (see snicco/snicco).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages