首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >重定向301和生成的动态搜索页

重定向301和生成的动态搜索页
EN

Stack Overflow用户
提问于 2016-04-27 18:55:22
回答 1查看 47关注 0票数 1

我做了一些将301从旧域重定向到新主机上的新域。它工作的很好,但我有很多404在谷歌网站管理员生成的动态搜索页面。例如: www.newdomain.com/store/catalogsearch/result/index/?cat=60&dir=desc&limit=15&mod‌​e=grid&order=price&p=2&q=makita.但是,我认为这是爬行在旧的领域,因为搜索的词,现在重定向到新的领域。是否有一些通用规则可以将所有其他动态生成的搜索重定向到一个特定的页面,比如新域上的主页,而不降低我在google上的排名?在我的新域上,动态搜索页面已在robots.txt中被阻塞。这条路够不能再爬了吗?这是我重定向的一部分:

代码语言:javascript
复制
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(default|index)\.(html|php|htm)\ HTTP/ [NC]
RewriteRule ^(([^/]+/)*)(default|main|index)\.(html|php|htm)$ http://www.newdomain.com/$1 [R=301,NC]
RewriteRule ^store/?$ http://www.newdomain.com [L,NC,R=301]
RewriteRule ^store/folder/?$ http://www.newdomain.com.br/otherfolder/another-folder/ [L,NC,R=301]
RewriteRule ^store/folder1/folder2/?$ http://www.newdomain.com/folder-3/folder-4 [L,NC,R=301]
...
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,NE,L]

提前谢谢你的帮助。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-04-27 19:18:14

好,在RewriteEngine On下面插入此规则,将这些动态URL重定向到新域的主页:

代码语言:javascript
复制
RewriteCond %{THE_REQUEST} /store/catalogsearch/result/index/ [NC]
RewriteRule ^ http://www.newdomain.com/? [L,R=301]
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36898554

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档