PHPackages                             execut/yii2-robots-txt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. execut/yii2-robots-txt

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

execut/yii2-robots-txt
======================

Module for generate robots.txt file by url rules

1.2.3(7y ago)713.2k↓25%21Apache-2.0PHP

Since Jul 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/execut/yii2-robots-txt)[ Packagist](https://packagist.org/packages/execut/yii2-robots-txt)[ Docs](https://github.com/execut/yii2-robots-txt)[ RSS](/packages/execut-yii2-robots-txt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (1)

Yii2 module for generate robots.txt file by url rules
=====================================================

[](#yii2-module-for-generate-robotstxt-file-by-url-rules)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

### Install

[](#install)

Either run

```
$ php composer.phar require execut/yii2-robots-txt "dev-master"

```

or add

```
"execut/yii2-robots-txt": "dev-master"

```

to the `require` section of your `composer.json` file.

Configuration example
---------------------

[](#configuration-example)

Add to application config folowing rules:

```
[
    'components' => [
        'urlManager' => [
            'rules' => [
                ['pattern' => 'robots', 'route' => 'robotsTxt/web/index', 'suffix' => '.txt'],
            ]
        ]
    ],
    'modules' => [
        'robotsTxt' => [
            'class' => 'execut\robotsTxt\Module',
            'components'    => [
                'generator' => [
                    'class' => \execut\robotsTxt\Generator::class,
                    'host' => 'localhost',
                    'sitemap' => 'sitemap.xml',
                    //or generate link through the url rules
                    'sitemap' => [
                        'sitemapModule/sitemapController/sitemapAction',
                    ],
                    'userAgent' => [
                        '*' => [
                            'Disallow' => [
                                'noIndexedHtmlFile.html',
                                [
                                    'notIndexedModule/noIndexedController/noIndexedAction',
                                    'noIndexedActionParam' => 'noIndexedActionParamValue',
                                ]
                            ],
                            'Allow' => [
                                //..
                            ],
                        ],
                        'BingBot' => [
                            'Sitemap' => '/sitemapSpecialForBing.xml',
                            'Disallow' => [
                                //..
                            ],
                            'Allow' => [
                                //..
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
];
```

After configuration robots.txt file is opened by /robots.txt link

License
-------

[](#license)

**yii2-robots-txt** is released under the Apache License Version 2.0. See the bundled `LICENSE.md` for details.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~513 days

Total

3

Last Release

2560d ago

Major Versions

0.1.1 → 1.2.22017-08-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ffb982747c04d8d93e2db3f8d90e44864c7c2a21a4c3d00ffbe66325f3f91c4?d=identicon)[execut](/maintainers/execut)

---

Top Contributors

[![execut](https://avatars.githubusercontent.com/u/2357407?v=4)](https://github.com/execut "execut (10 commits)")

---

Tags

yii2robots.txt

### Embed Badge

![Health badge](/badges/execut-yii2-robots-txt/health.svg)

```
[![Health](https://phpackages.com/badges/execut-yii2-robots-txt/health.svg)](https://phpackages.com/packages/execut-yii2-robots-txt)
```

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
