2017 © Pedro Peláez
 

symfony-bundle robots-txt-bundle

Robots.txt generator for Symfony 2 & 3

image

miisieq/robots-txt-bundle

Robots.txt generator for Symfony 2 & 3

  • Friday, December 15, 2017
  • by miisieq
  • Repository
  • 1 Watchers
  • 1 Stars
  • 104 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 174 % Grown

The README.md

MiisieqRobotsTxtBundle

SensioLabsInsight Style-CI Travis CI Coverage Downloads Release
SensioLabsInsight StyleCI Travis CI codecov Total Downloads Latest Stable Version

The problem

It's pretty common workflow that we work on our projects in local environment, then deploy code to preproduction or staging server for out client to approve the work, then finally push to production environment., (*1)

While we absolutely want crawlers to index our production environment, we don't want to see our test servers in search results., (*2)

How it works?

Depending on the Symfony environment, application will return robots.txt file with rule that allows to index whole content only we are in prod environment. In case of another environment, the application will block whole site from indexing., (*3)

Installation

Step 1: Install the bundle

First, open a command console, enter your project directory and execute the following command to download the latest version of this bundle:, (*4)

composer require miisieq/robots-txt-bundle

Step 2: Register the bundle in your kernel

Then add the bundle to your kernel:, (*5)

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...

            new Miisieq\RobotsTxtBundle\MiisieqRobotsTxtBundle(),
        ];

        // ...
    }
}

Step 3: Configure the bundle

Add the following to your config file:, (*6)

``` yaml, (*7)

app/config/config.yml

miisieq_robots_txt: ~, (*8)


You can easily add links to your site maps: ``` yaml # app/config/config.yml miisieq_robots_txt: host: http://example.com production_environment: prod sitemaps: - "/sitemap.xml" - "/catalog/sitemap.xml"

Step 4: Register the routes

To allow to get your robots.txt file, register the following route:, (*9)

# app/config/routing.yml
miisieq_robots_txt:
    resource: "@MiisieqRobotsTxtBundle/Resources/config/routes.yaml"
    prefix:   /

Step 5: Remove static robots.txt file (if exists)

rm web/robots.txt

The Versions

15/12 2017

dev-master

9999999-dev

Robots.txt generator for Symfony 2 & 3

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony robots robots.txt

11/10 2017

v1.1.0

1.1.0.0

Robots.txt generator for Symfony 2 & 3

  Sources   Download

MIT

bundle symfony robots robots.txt

11/10 2017

dev-analysis-8KJoW2

dev-analysis-8KJoW2

Robots.txt generator for Symfony 2 & 3

  Sources   Download

MIT

bundle symfony robots robots.txt

06/10 2017

v1.0.1

1.0.1.0

Robots.txt generator for Symfony 2 & 3

  Sources   Download

MIT

bundle symfony robots robots.txt

06/10 2017

v1.0.0

1.0.0.0

Robots.txt generator for Symfony 2 & 3

  Sources   Download

MIT

bundle symfony robots robots.txt