Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall
1, IIS under 301 settings
Internet Information Services Manager-> virtual directory-> to a URL, enter the destination URL that needs to be redirected, and select Permanent redirect for resources.
2, ASP 301 Steering Code
<%@ Language=vbscript%>
<%
Response.status= "Moved Permanently"
Response.AddHeader "Location", "http://www.****.cn/articles/301/"
%>
3. ASP. NET 301 Steering Code
<script runat= "Server" >
private void Page_Load (object sender, System.EventArgs e)
{
Response.Status = "Moved Permanently";
Response.AddHeader ("Location", "http://www.****.cn/articles/301/");
}
</script>
4, PHP under the 301 steering code
Header ("http/1.1 moved Permanently");
Header ("location:http://www.****.cn/articles/301/");
Exit ();
5, CGI Perl 301 Steering Code
$q = new CGI;
Print $q->redirect ("http://www.****.com/");
6, JSP under the 301 steering code
<%
Response.setstatus (301);
Response.setheader ("Location", "http://www.****.cn/");
Response.setheader ("Connection", "close");
%>
7, Apache 301 Turn Code
Create a new. htaccess file and enter the following (you need to turn on mod_rewrite):
1 Change the domain name without www to the domain name with www
Options +followsymlinks
Rewriteengine on
Rewritecond%{http_host} ^lesishu.cn [NC]
Rewriterule ^ (. *) $ http://www.****.cn/$1 [l,r=301]
2 Redirect to new domain
Options +followsymlinks
Rewriteengine on
Rewriterule ^ (. *) $ http://www.****.cn/$1 [l,r=301]
3) using regular 301 steering to achieve pseudo static
Options +followsymlinks
Rewriteengine on
Rewriterule ^news-(. +) \.html$ news.php?id=$1
Turn news.php?id=123 Such an address to news-123.html
8, Apache lower vhosts.conf configuration 301 Turn
In order to achieve URL normalization, SEO will usually change the domain name without www to the WWW domain name, vhosts.conf is configured as:
<virtualhost *:80>
ServerName www.****.cn
Documentroot/home/lesishu
</VirtualHost>
<virtualhost *:80>
ServerName lesishu.cn
Redirectmatch permanent ^/(. *) http://www.****.cn/$1
</VirtualHost>
Apache In addition to the above 2 methods, there are other configuration methods and optional parameters, it is recommended to read the Apache document.