vendredi 3 mai 2019

Spatie Sitemap not generating URLs on localhost

I am creating a website in Laravel 5.8 and using Spatie sitemap package to create Sitemap dynamically, It doesn't crawl my website and only generates homepage URL.

Route::get('/sitemap',function(){
    SitemapGenerator::create( 'http://localhost/' )->writeToFile('sitemap.xml');
})->name('sitemap-generator');

Note: But when I map website with a virtual host, It is working properly.

Route::get('/sitemap',function(){
    SitemapGenerator::create( 'http://local.project.com/' )->writeToFile('sitemap.xml');
})->name('sitemap-generator');

Any help will be appreciated.



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2Y3oGdh
via IFTTT

Aucun commentaire:

Enregistrer un commentaire