Frustrated: Dynamic Laravel Sitemap Not Updating Routes Correctly, Getting 404 Errors
0
man, i'm pulling my hair out trying to get this dynamic XML sitemap working right for my new Laravel app. i'm using that 'Dynamic XML Sitemap for Laravel & All Websites' tool, and it was mostly fine, but now it's just broken. the main issue is whenever i add new routes or change existing ones, the sitemap just *doesn't* update. google search console is yelling at me about tons of 404s, and i can see the old routes still in the generated sitemap file. it's like it's cached or something, but i've cleared everything. this is really affecting my laravel development efforts.
here's a snippet from the logs when it tries to hit an old route that doesn't exist anymore:
thanks in advance for any help!
here's a snippet from the logs when it tries to hit an old route that doesn't exist anymore:
[2023-10-27 14:35:01] local.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No query results for model [App\Models\BlogPost] with id [old-route-slug] in /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:470
Stack trace:
#0 /var/www/html/app/Http/Controllers/SitemapController.php(78): Illuminate\Database\Eloquent\Builder->firstOrFail()
#1 [internal function]: App\Http\Controllers\SitemapController->generate()
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction()i've tried php artisan cache:clear, config:clear, route:clear, even view:clear. i've run composer dump-autoload. i've manually deleted the generated sitemap file and tried regenerating. nothing seems to force it to pick up the new routes or drop the old ones immediately. sometimes it updates after like an hour, sometimes not at all. is there some deep laravel caching i'm missing? or maybe a specific command to force the sitemap package to re-scan all routes? i'm desperate for a fix, this is killing my SEO.thanks in advance for any help!
0 Answers
No answers yet.
Be the first to provide a helpful answer!
Your Answer
You must Log In to post an answer and earn reputation.
Hot Discussions
3
Better ISP finder data?
269 Views