<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LeNgHoSt的小窝 &#187; 301重定向</title>
	<atom:link href="http://www.lenghost.cn/tag/301%e9%87%8d%e5%ae%9a%e5%90%91/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lenghost.cn</link>
	<description>I did it my way, 'Cause it's my life!</description>
	<lastBuildDate>Tue, 08 Nov 2011 23:39:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>如何更改网站域名(使用301重定向)</title>
		<link>http://www.lenghost.cn/tips/change-domain-use-301-redirect/</link>
		<comments>http://www.lenghost.cn/tips/change-domain-use-301-redirect/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 16:01:57 +0000</pubDate>
		<dc:creator>LeNgHoSt</dc:creator>
				<category><![CDATA[技巧收集]]></category>
		<category><![CDATA[301重定向]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[域名]]></category>

		<guid isPermaLink="false">http://www.lenghost.cn/?p=854</guid>
		<description><![CDATA[301 redirect: 301代表永久性转移(Permanently Moved)，301重定向是网页更改地址后对搜索引擎友好的最好方法，只要不是暂时搬移的情况，都建议使用301来做转址。
Apache服务器实现301重定向
Apache实现301重定向非常简单，只需要在.htaccess里加几行代码就可以了。
比如要把当前网站的域名修改为www.aaa.com，我只需要修改.htaccess为：
RewriteEngine On
RewriteBase /
RewriteRule (.*) http://www.aaa.com/$1 [R=301,L] 
这样修改后，用户在访问当前网站的所有页面时，都会被重定向到新域名的对应地址。
比如原来域名是www.bbb.com，那当用户访问http://www.bbb.com/news/123.html的时候，地址栏会自动重定向到http://www.aaa.com/news/123.html。

网站做好301重定向后，还要通知搜索引擎，不然可能要很长时间才能收录新域名。
最简单的方法就是使用Google网站管理员工具，里面有地址更改选项。

登录Google网站管理员工具，选择要更改的域名，左边点开网站配置 &#8211; 地址更改，更改界面如上图所示，Google显示地址更改一共分四个步骤，这里前三个步骤我们已经做完了，直接在第四个步骤里，选择新域名，点击提交即可。
提交后在Google网站管理员工具首页会看到地址变更通知，你也可以随时撤销该变更。
]]></description>
			<content:encoded><![CDATA[<p>301 redirect: 301代表永久性转移(Permanently Moved)，301重定向是网页更改地址后对搜索引擎友好的最好方法，只要不是暂时搬移的情况，都建议使用301来做转址。</p>
<p><strong>Apache服务器实现301重定向</strong><br />
Apache实现301重定向非常简单，只需要在.htaccess里加几行代码就可以了。<br />
比如要把当前网站的域名修改为www.aaa.com，我只需要修改.htaccess为：</p>
<blockquote><p>RewriteEngine On<br />
RewriteBase /<br />
RewriteRule (.*) http://www.aaa.com/$1 [R=301,L] </p></blockquote>
<p>这样修改后，用户在访问当前网站的所有页面时，都会被重定向到新域名的对应地址。<br />
比如原来域名是www.bbb.com，那当用户访问http://www.bbb.com/news/123.html的时候，地址栏会自动重定向到http://www.aaa.com/news/123.html。<br />
<span id="more-854"></span><br />
网站做好301重定向后，还要通知搜索引擎，不然可能要很长时间才能收录新域名。<br />
最简单的方法就是使用Google网站管理员工具，里面有地址更改选项。<br />
<img src="http://www.lenghost.cn/wp-content/uploads/2009/12/googlewebmaster.png" alt="googlewebmaster" title="googlewebmaster" width="611" height="520" class="alignnone size-full wp-image-853" /><br />
登录Google网站管理员工具，选择要更改的域名，左边点开<em>网站配置</em> &#8211; <em>地址更改</em>，更改界面如上图所示，Google显示地址更改一共分四个步骤，这里前三个步骤我们已经做完了，直接在第四个步骤里，选择新域名，点击提交即可。<br />
提交后在Google网站管理员工具首页会看到地址变更通知，你也可以随时撤销该变更。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lenghost.cn/tips/change-domain-use-301-redirect/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

