frosh / robots-txt
生成robots.txt
0.2.0
2024-04-22 07:19 UTC
Requires
- shopware/core: ~6.5.0 || ~6.6.0
README
此插件为Shopware 6商店提供robots.txt文件。目前无法区分不同的用户代理。请注意,通常只有根目录下的robots.txt(查看格式)将被考虑。
允许和禁止规则
目前存在以下默认规则
Allow: /
Disallow: /*?
Allow: /*theme/
如果您需要修改它们,应该通过模板修改。如果有其他对他人有用的通用规则,请考虑创建一个pull request。
可以在插件配置中配置允许和禁止规则。每一行都需要以Allow:
或Disallow:
开头,后面跟URI路径。生成的robots.txt将包含每个路径前缀为绝对基本路径。
例如,假设您为一个销售渠道配置了两个“域”example.com
和example.com/en
,并且插件配置如下
Disallow: /account/
Disallow: /checkout/
Disallow: /widgets/
Allow: /widgets/cms/
Allow: /widgets/menu/offcanvas
位于example.com/robots.txt
的robots.txt包含
Disallow: /en/account/
Disallow: /en/checkout/
Disallow: /en/widgets/
Allow: /en/widgets/cms/
Allow: /en/widgets/menu/offcanvas
Disallow: /account/
Disallow: /checkout/
Disallow: /widgets/
Allow: /widgets/cms/
Allow: /widgets/menu/offcanvas
网站地图
除了规则之外,还将在包含域名的网站地图中链接。再次假设我们已配置了域名example.com
和example.com/en
,robots.txt将包含
Sitemap: https://example.com/en/sitemap.xml
Sitemap: https://example.com/sitemap.xml