我的网站有一个问题,谷歌机器人。在网站管理员工具中,谷歌显示了404个没有找到的页面错误。
错误页面的模式很简单,如下所示
Domain.com/post-type-1
Domain.com/post-type-2
Domain.com/post-type-3
Domain.com/category/x/post-type-1
Domain.com/category/x/post-type-2
Domain.com/category/x/post-type-3
Domain.com/category/y/post-type-1
Domain.com/category/y/post-type-2我想知道如何通过.htaccess重定向所有这些错误?
发布于 2016-06-25 15:02:12
您可以将此重定向放置在.htaccess的顶部:
RewriteRule (?:^|/)post-type-\d+ /? [L,R=301]https://stackoverflow.com/questions/38027594
复制相似问题