今天在跟一个做外贸的朋友做网站SEO诊断,网站架构是用zen cart商城系统搭建的,可一查根目录下竟然没有robots.txt文件。这显然是会影响到SEO排名的。因为合理设置zen cart robots.txt文件,可以避免因为重复页面等问题大大减慢排名生效时间。以下就是具体的 zen cart robots.txt 写法
首先新建一个文本文件命名为robots.txt,然后复制粘贴以下代码到 robots.txt保存,上传到网站空间根目录;如果zen cart不在根目录,请修改 Disallow: /cache/ 这类目录路径。(注:不论zen cart 系统安装有哪里,robots.txt文件只能上传到空间根目录才对搜索引擎有效。)
User-agent: * Disallow: /cache/ Disallow: /contrib/ Disallow: /docs/ Disallow: /extras/ Disallow: /htmlarea/ Disallow: /stats/ Disallow: /sitemap/ Disallow: /graphics/ Disallow: /login.html Disallow: /privacy.html Disallow: /conditions.html Disallow: /contact_us.html Disallow: /gv_faq.html Disallow: /discount_coupon.html Disallow: /unsubscribe.html Disallow: /shopping_cart.html Disallow: /ask_a_question.html Disallow: /popup_image_additional.html Disallow: /product_reviews_write.html Disallow: /tell_a_friend.html Disallow: /pages-popup_image.html? Disallow: /popup_image_additional.html? Disallow: /login.html User-agent: Googlebot-Image Disallow: /
#您希望您的照片在谷歌图片搜索中出现请删除最后两行 User-agent: Googlebot-Image 和Disallow: /。
在上面的zen cart robots.txt 写法中为什么不禁止搜索引擎蜘蛛访问admin目录呢?
原因在于设置 Disallow: /admin/后会暴露后台管理目录,造成安全隐患,建议将管理员目录改成与系统其它目录相近的名称,
再禁止索引该目录。








