frosh/robots-txt

生成robots.txt

安装次数: 9,312

依赖项: 0

建议者: 0

安全性: 0

星标: 9

关注者: 2

分支: 1

开放问题: 2

类型:shopware-platform-plugin

0.2.0 2024-04-22 07:19 UTC

This package is auto-updated.

Last update: 2024-09-22 08:07:13 UTC


README

Twitter Follow Slack

此插件为Shopware 6商店提供robots.txt文件。目前无法区分不同的用户代理。请注意,通常只有根目录下的robots.txt(查看格式)将被考虑。

允许和禁止规则

目前存在以下默认规则

Allow: /
Disallow: /*?
Allow: /*theme/

如果您需要修改它们,应该通过模板修改。如果有其他对他人有用的通用规则,请考虑创建一个pull request。

可以在插件配置中配置允许和禁止规则。每一行都需要以Allow:Disallow:开头,后面跟URI路径。生成的robots.txt将包含每个路径前缀为绝对基本路径。

例如,假设您为一个销售渠道配置了两个“域”example.comexample.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.comexample.com/en,robots.txt将包含

Sitemap: https://example.com/en/sitemap.xml
Sitemap: https://example.com/sitemap.xml