Laravel 5.6 spatie/laravel-sitemap生成默认的xml行且没有路由 [英] Laravel 5.6 spatie/laravel-sitemap generates the default xml line and no routes

查看:73
本文介绍了Laravel 5.6 spatie/laravel-sitemap生成默认的xml行且没有路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我吗?

嗨.我尝试使用控制台命令生成sitemap.xml.它总是生成默认的sitemap.xml文件.

Hi. I have tried using Console command to generate the sitemap.xml. It always generate the default sitemap.xml file.

` urlset xmlns=" http: //www.sitemaps.org/schemas/sitemap/0.9 " `

` xmlns:xhtml = " http: //www.w3.org/1999/xhtml "`

然后我尝试在路由中手动使用它,以检查控制台命令是否存在问题.

I then tried to use it manually in my routes in order to check whether there is a problem with console command.

它再次生成了相同的默认xml.

It generated the same default xml again.

我认为自己的路线可能有问题.然后,我添加了简单的路线,例如.

I thought there might be something wrong with my routes. I then added simple routes like.

Route::get('/', function() {
return view('welcome');
});

Route::get('/about', function() {
return view('welcome');
});

但是它仍然通过控制台命令和访问路由生成了相同的默认xml.

But still it generated that same default xml both from console command and from visiting a route.

推荐答案

问题是我的docker环境.我在Windows上使用了laragon,可以完美地创建站点地图.

The problem was my docker environment. I used laragon on windows, which perfectly create the sitemap.

对于google seo,请从站点地图中删除动态路线.

For google seo kindly do remove dynamic routes from sitemap.

这篇关于Laravel 5.6 spatie/laravel-sitemap生成默认的xml行且没有路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆