如何通过htaccess重定向规则删除部分网址

时间:2015-09-14 12:21:41

标签: php apache .htaccess mod-rewrite redirect

由于某些原因,Google addbot会生成以下链接:

https://batteryservice.bg/продукт/фенер-nitecore-mt40gt/batteryservice.bg

我想删除最后一部分/batteryservice.bg,并有类似的内容:

https://batteryservice.bg/продукт/фенер-nitecore-mt40gt/

我尝试了this解决方案,例如:RewriteRule ^(.+)/batteryservice.bg /$1 [R=301,L,NC]但这对我没用。

1 个答案:

答案 0 :(得分:0)

这个工作很奇怪RewriteRule ^(.+)/batteryservice.bg https://batteryservice.bg/$1 [R=301,L,NC]

相关问题