se7enxweb/xrowmetadata

为内容对象添加SEO元数据,同时也为eZ Publish提供网站地图功能

v1.3.5 2024-01-29 14:23 UTC

This package is auto-updated.

Last update: 2024-08-29 15:36:34 UTC


README

安装

安装此扩展后。您应该能够使用runcronjobs.php脚本来生成网站地图。有关更多配置选项,请参阅"xrowsitemap.ini"。

php runcronjobs.php sitemap;

php runcronjobs.php sitemap;

Running cronjob part 'sitemap'
Running extension/xrowmetadata/cronjobs/sitemap.php at: 14.10.2011 12:31
Generating Regular Sitemaps...

Generating Sitemap for Siteaccess XYZ 

Adding 578 nodes to the sitemap.
578 / 578 [+++++++++++++++++++++++++++++++++++++++++++++++++++++++++>] 100,00%

Sitemap var/storage/sitemap/XYZ/urlset_standard_XYZ.xml for siteaccess XYZ has been generated.

Completing extension/xrowmetadata/cronjobs/sitemap.php at: 14.10.2011 12:31
Elapsed time: 00:00:08

这将在eZ Publish根目录中为每个siteaccess创建一个文件。这些文件通常命名为"sitemap_access.xml",但在INI文件中可以更改。

请确保您的Apache重写规则允许访问XML文件。这可以通过向您的.htaccess或Apache配置文件添加以下行来完成

RewriteRule ^sitemap[^/]*\.xml - [L]

最后,您需要将元数据类型附加到一些内容类上,并将以下代码添加到您的HTML文档的头部。

{def $meta = metadata( $module_result.node_id ) } {if $meta} {if $meta.title} <title>{$meta.title|wash}</title> {/if} {if $meta.keywords} {/if} {if $meta.description} {/if} {else} <title>{$site_title}</title> {foreach $site.meta as $key => $item } {/foreach} {/if}

在robots.txt中注册网站地图

选项1.) 将此添加到"robots.txt"文件的末尾

网站地图: http://www.example.com/sitemaps/index

选项2.) 将此添加到".htaccess"文件的末尾

RewriteRule ^robots\.txt$ - [C]
RewriteRule .* http://%{HTTP_HOST}/sitemaps/robots [P]

RewriteRule ^sitemap\.xml$ - [C]
RewriteRule .* http://%{HTTP_HOST}/sitemaps/index [P]

故障排除 & 支持

向service [at] xrow [dot] de发送电子邮件