正确配置的301重定向搜索引擎优化合规? [英] Proper configuring of 301 redirects for SEO compliance?

查看:191
本文介绍了正确配置的301重定向搜索引擎优化合规?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很多来自组织成员的研究和帮助后,我已经清除我的.htaccess的第一个主要的障碍。

After a lot of research and help from SO members, I have cleared my first major hurdle with .htaccess.

我的新的.htaccess文件成功重命名我的的index.php 页, /家居,并采取所有查询附连到链接字符串:

My new .htaccess file successfully renames my index.php page to /home and takes all of the query strings attached to the links:

http://www.website.com/departments?nav=business (等)

和把他们变成我想要的格式为:

and turns them into the format I want:

http://www.website.com/business

下面是我的.htaccess code:

Here is my .htaccess code:

AddDefaultCharset UTF-8
RewriteEngine On
RewriteBase /

RewriteRule ^/?Home/?$ /index.php [L,NC]

RewriteRule ^([a-zA-Z-?]+)/?$ departments.php?nav=$1 [L]

如果以上任何code是不理想,我收集了在我的研究在线和我仍然在学习它。

If any of the above code isn't ideal, I've collected it in my research online and I'm still learning from it.

我的问题是,现在我已经重新定义了联系,我知道我应该做301重定向使旧链接不为重复或类似的搜索引擎的出现。我向你道歉了前面没有所有的行话下来,但这是研究的一个长二一天这一点。

My question is, now that I have redefined the links, I know I should do a 301 redirect so that the old links don't show up as duplicates or some such with the search engines. I apologize up front for not having all the lingo down, but this is a long day two of research on this.

什么是正确的code,以便做重定向保持页面搜索引擎友好的增加?

What is the proper code to add in order to do the redirect to keep the page SEO friendly?

提前感谢!

推荐答案

请你重写规则:

RewriteRule ^([a-zA-Z-?]+)/?$ departments.php?nav=$1 [L,R=301]

这将使你的链接做301重定向到新的URL。

Which will make your links do a 301 redirect to your new URLs.

这篇关于正确配置的301重定向搜索引擎优化合规?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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