Google不知何故索引了许多分层的导航URL,并导致成千上万的抓取错误。
为了解决该问题,我想对包含关键字“过滤器”的网址进行301重定向
https://www.example.com/some-url-key/Filter/brand/Brand 1 / dir / asc / order / more-parameters / Parameter1,Parameter2 /
https://www.example.com/some-url-key-2/Filter/brand/Brand 1 / dir / asc / order / more-parameters / Parameter1,Parameter2 /
到
并从网址中删除其他过滤器,以使其对SEO更友好。
到目前为止,我制定的重写规则是
RewriteCond %{REQUEST_URI} /Filter
RewriteRule ^(.*)$ https://www.example.com/some-url-key [L,R=301,NC]
但是在RewriteRule中,我希望“ some-url-key”部分是动态的,而与现在的静态不同。
您可以使用以下规则:
RewriteRule ^([^/]+)/filter/.+$ /$1 [NC,L,R]
确定重定向正常时,将R更改为R = 301。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句