修复ecshop商场的站点地图功能(sitemaps.xml)

2008年10月8日 | 23:42分类:网页设计 | 标签: | 90 views

安装了ecshop utf8 2.60,测试发现生成的sitemaps.xml位于data/sitemaps.xml,还会出现如下提示:

Warning: file_put_contents(../sitemaps.xml) [function.file-put-contents]: failed to open stream: Permission denied in /var/www/html/ecshop/ecshopv260/admin/includes/cls_google_sitemap.php on line 72

且站点的robots.txt内容中有含有Disallow: /data/语句,这样的话,在google后台管理界面提交的站点地图是不能生效的,如下图:

ecshop-sitemap-01

ecshop-sitemap-01

而如果修改robots.txt 去掉Disallow: /data/语句,还是不建议这样操作,那有什么更好的办法呢,经过测试,可以通过下列方式改进

  1. 在根目录新建立一个空的sitemaps.xml文件,通过如下命令

    # touch sitemaps.xml
  2. 修改此文件的所属人为apache
    # chown apache:apache sitemaps.xml

经过上两个步骤后,在运行后台管理下的【系统设置】–>【站点地图】,就能正常更新根目录下的地图文件sitemaps.xml,如下截图所示:

ecshop-sitemap-02

ecshop-sitemap-02

发表您的评论

您的名字: (*必填)

您的邮箱: (*不会被公布 ,必填)

您的网站:

*
To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
Click to hear an audio file of the anti-spam word