Download the PHP package miisieq/robots-txt-bundle without Composer
On this page you can find all versions of the php package miisieq/robots-txt-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download miisieq/robots-txt-bundle
More information about miisieq/robots-txt-bundle
Files in miisieq/robots-txt-bundle
Package robots-txt-bundle
Short Description Robots.txt generator for Symfony 2, 3 & 4
License MIT
Informations about the package robots-txt-bundle
MiisieqRobotsTxtBundle
SensioLabsInsight | Style-CI | Travis CI | Coverage | Downloads | Release |
---|---|---|---|---|---|
![]() |
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.
While we absolutely want crawlers to index our production
environment, we don't want to see our test servers in search results.
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.
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:
Step 2: Register the bundle in your kernel
Then add the bundle to your kernel:
Step 3: Configure the bundle
Add the following to your config file:
You can easily add links to your site maps:
Step 4: Register the routes
To allow to get your robots.txt
file, register the following route:
Step 5: Remove static robots.txt
file (if exists)
All versions of robots-txt-bundle with dependencies
symfony/config Version ~2.0|~3.0|~4.0
symfony/http-kernel Version ~2.0|~3.0|~4.0