﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-生意发营销软件-最新评论</title><link>http://www.cppblog.com/shang025wei/CommentsRSS.aspx</link><description>生意发软件</description><language>zh-cn</language><pubDate>Tue, 05 Jul 2011 08:57:56 GMT</pubDate><lastBuildDate>Tue, 05 Jul 2011 08:57:56 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: 怎么做301重定向啊</title><link>http://www.cppblog.com/shang025wei/archive/2011/07/05/150235.html#150242</link><dc:creator>溪流</dc:creator><author>溪流</author><pubDate>Tue, 05 Jul 2011 14:06:00 GMT</pubDate><guid>http://www.cppblog.com/shang025wei/archive/2011/07/05/150235.html#150242</guid><description><![CDATA[如果可以改 .htaccess，那就用 Rewrite：<br>RewriteEngine On<br>RewriteCond %{http_host} ^cnmo4g.com<br>RewriteRule ^(.*)$ <a target="_new" href="http://www.cnmo4g.com/">http://www.cnmo4g.com/</a>$1 [R=301]<br><br>不然，在页面里实现。先判断当前域名是否为 conm4g.com，如果是，则——<br><br>PHP：<br>&lt;?<br>header(&quot;HTTP/1.1 301 Moved Permanently&quot;);<br>header(&quot;Location: <a target="_new" href="http://www.cnmo4g.com/">http://www.cnmo4g.com/</a>...&quot;); // “...”部分是页面路径<br>?&gt;<br>ASP：<br>&lt;%<br>Response.Status = &quot;301 Moved Permanently&quot; <br>Response.AddHeader &quot;Location&quot;,&quot;<a target="_new" href="http://www.cnmo4g.com/">http://www.cnmo4g.com/</a>...&quot;    '“...”部分是页面路径<br>Response.End<br>%&gt;<br><img src ="http://www.cppblog.com/shang025wei/aggbug/150242.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/shang025wei/" target="_blank">溪流</a> 2011-07-05 22:06 <a href="http://www.cppblog.com/shang025wei/archive/2011/07/05/150235.html#150242#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>