与重定向htaccess的同时避免搜索引擎的惩罚 [英] redirecting with htaccess while avoiding search engine penalty

查看:135
本文介绍了与重定向htaccess的同时避免搜索引擎的惩罚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,已经运行了2年了,它获得了当时的一些搜索引擎的声誉,现在我感兴趣的使用htaccess的就可以了, 重命名的东西,如:

I have a website that has been up for about 2 years now, it gained some search engine reputation over the time, and now I'm interested in using htaccess on it, to rename things such as:

/index.php?act=Login 简单地 /登录

/index.php?act=Login to simply /Login

现在的问题是,搜索引擎会同时看到的网址,登录页面远非唯一的URL我将重新命名。 其中价值,我的整个网站将有双重现在有网址p $ ptty的多手段, 我能做些什么,以prevent从造成损失的搜索引擎优化?

Now the problem is, that search engines will see both urls, and the login page is far from being the only url I will rename. Which pretty much means that my entire website will have double the urls it has now, What can I do to prevent it from causing damage to the SEO?

有一些线路的htaccess code,我可以用它来重定向旧网页到新的呢? (我甚至不知道这会解决的SEO问题)

Is there some line of htaccess code I could use to redirect the old pages to the new ones as well? (I'm not even sure if that'll solve the SEO issue)

在此先感谢

推荐答案

底线是使用 R = 301 被永久移动),以告诉搜索引擎你的新网址。对于前有你的.htaccess code是这样的:

Bottom line is to use R=301 (moved permanently) to inform search engines about your new URLs. For ex have your .htaccess code like this:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

# external redirect using R=301 to /login from /index.php?act=Login
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+(index\.php/?|)\?act=login(&|\s) [NC]
RewriteRule ^ /login? [R=301,L]

# internal forward from /login to /index.php?act=Login
RewriteRule ^login/?$ index.php?act=login [L,QSA,NC]

使用 R = 301 指令,搜索引擎最终将开始缓存的旧的新的URI方案,而不是。

With R=301 directive search engines will eventually start caching your new URI scheme instead of the old ones.

这篇关于与重定向htaccess的同时避免搜索引擎的惩罚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆