Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 阻止链接在Opencart中被索引_.htaccess_Opencart_Robots.txt - Fatal编程技术网

.htaccess 阻止链接在Opencart中被索引

.htaccess 阻止链接在Opencart中被索引,.htaccess,opencart,robots.txt,.htaccess,Opencart,Robots.txt,最近,我似乎收到了很多来自谷歌网站管理员工具的404错误。有没有办法禁止这些链接被编入索引?他们来自哪里 如果你能解释一下这件事,我将不胜感激。提前谢谢 我在opencart 1.5.4.1上 这些是404错误 http://mydomain.com/product/search&filter_tag=Purse&sort=rating&order=ASC&limit=25 http://mydomain.com/product/search&sort=p

最近,我似乎收到了很多来自谷歌网站管理员工具的404错误。有没有办法禁止这些链接被编入索引?他们来自哪里

如果你能解释一下这件事,我将不胜感激。提前谢谢

我在opencart 1.5.4.1上

这些是404错误

http://mydomain.com/product/search&filter_tag=Purse&sort=rating&order=ASC&limit=25
http://mydomain.com/product/search&sort=p.price&order=DESC&filter_tag=&limit=25
http://mydomain.com/cart?qty=1&id_product=323&token=bfcf19e76ed4a88abd8508e8dc097a70&add
我还在我的robots.txt中包含了以下条目,但没有用

User-agent: Googlebot

User-agent: *
Disallow: /cgi-bin
Disallow: /*?limit
Disallow: /*&limit
Disallow: /*?sort
Disallow: /*&sort
Disallow: /*?route=checkout
Disallow: /*?route=account
Disallow: /*?route=product/search
Disallow: /*?route=affiliate
Disallow: /*&keyword
Disallow: /*?page=1

看起来您正在使用一个扩展,它试图将丑陋的url重写为更好/更友好的url,或者曾经使用过。您应该使用.htaccess将错误的URL重写为正确的URL,而不是尽可能只阻塞页面。这将有助于您的网站

谢谢Jay。我以前确实使用了一个扩展来将其更改为SEF链接,但在它导致一些兼容性问题后被禁用。至于htaccess,你能给我一些关于如何重定向坏URL的建议吗?我的错误层出不穷。网上有很多关于如何做到这一点的指南(在这个网站上)。这里有一个例子-