2017 © Pedro Peláez
 

library robots-txt-bundle

Simple Symfony2 which generates robots.txt based on config setting

image

ricbra/robots-txt-bundle

Simple Symfony2 which generates robots.txt based on config setting

  • Monday, November 6, 2017
  • by ricbra
  • Repository
  • 1 Watchers
  • 3 Stars
  • 4,853 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 1 % Grown

The README.md

RicbraRobotsTxtBundle

After solving the same problem for the fifth time I thought it was time to create a Bundle for this problem. I did again an extensive search on any other available material but I guess everybody is solving this problem on his own. On KnpBundles.com and Packagist.org I couldn't find any Bundle for this. So I created this one instead., (*1)

The problem: your staging environment indexed in Google

We all have some different environments for your apps (staging, test, dev) and we all have experienced this in the past: Google indexed your staging environment and every now and then a real visitor ends up there. Of course you can IP-block the staging but this isn't always feasible., (*2)

Solution for Symfony2: configurable robots.txt

Update your config.yml:, (*3)

ricbra_robots_txt:
    allow_robots: %allow_robots%

In your parameters.yml file for production:, (*4)

allow_robots: true

In your staging|dev|test parameters file:, (*5)

allow_robots: false

Not really rocket science, but it works., (*6)

Installation

Composer ftw:, (*7)

$ composer require ricbra/robots-txt-bundle

Then enable the bundle:, (*8)

<?php
// app/AppKernel.php

$bundles = array(
    ...
    new Ricbra\Bundle\RobotsTxtBundle\RicbraRobotsTxtBundle(),
    ...
);

Update routing:, (*9)

// app/config/routing.yml
ricbra_robots_txt:
    resource: "@RicbraRobotsTxtBundle/Resources/config/routing.yml"
    prefix:   /

The Versions

06/11 2017

dev-master

9999999-dev

Simple Symfony2 which generates robots.txt based on config setting

  Sources   Download

MIT

The Requires

 

by Richard van den Brand

robots robots.txt crawlers spiders

06/12 2015

2.0.1

2.0.1.0

Simple Symfony2 which generates robots.txt based on config setting

  Sources   Download

MIT

The Requires

 

by Richard van den Brand

robots robots.txt crawlers spiders

06/12 2015

2.0.0

2.0.0.0

Simple Symfony2 which generates robots.txt based on config setting

  Sources   Download

MIT

The Requires

 

by Richard van den Brand

robots robots.txt crawlers spiders

29/10 2014

1.0.0

1.0.0.0

Simple Symfony2 which generates robots.txt based on config setting

  Sources   Download

MIT

The Requires

 

by Richard van den Brand

robots robots.txt crawlers spiders