2017 © Pedro Peláez
 

library robots-sitemap

Robots and sitemap generator package for laravel

image

mtz-jaime/robots-sitemap

Robots and sitemap generator package for laravel

  • Tuesday, November 21, 2017
  • by mtz-jaime
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Robots and Sitemap generator package

This package will help you to create a robots.txt file and a sitemap with all the get routes of your application on the fly., (*1)

Getting Started

Installation

Install via Composer., (*2)

composer require mtz-jaime/robots-sitemap

If you are using Laravel 5.5 this package already includes the auto discovery package. If for some reason you decided to remove this functionality on your application, add the service provider into your application config., (*3)

Do this by adding the following line to the 'providers' section of the application config (usually config/app.php):, (*4)

MtzJaime\RobotsSitemap\RobotsSitemapServiceProvider::class,

Publish the config file in order to have control to decide what to block in your robots or sitemap, (*5)

php artisan vendor:publish --provider="MtzJaime\RobotsSitemap\RobotsSitemapServiceProvider" --tag="config"

Code Usage

To enable the package features you need to add this new env variable BLOCK_SITE=false, (*6)

Configure the config file as better fit under your requirements., (*7)

'disallowURL' => 
[
    /mySecretPost
    /mySecretFolder/
],

'userAgent' => 
[
    'AgentName' => ['/', '/mySecretFolder/', '/mySecretPost']
],

'excludeSiteMap' => 
[
    // Do not include the initial '/'
    mySecretFolder/mySecretPost
    mySecretPost
],

Before trying to access the robots.txt be sure that you already delete the default robots.txt file that Laravel provide in public/robots.txt, (*8)

If you already deleted it and you get an 404 error, remove the following line from your nginx file or similar in apache, (*9)

location = /robots.txt  { access_log off; log_not_found off; }

The Versions

21/11 2017

dev-master

9999999-dev

Robots and sitemap generator package for laravel

  Sources   Download

MIT

by Jaime Martinez

laravel sitemap robots