How to achieve 301 redirection

Source: Internet
Author: User
Keywords 301 redirect

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Because 302 redirect is a temporary redirect, it is easy to hijack the site, and hijack the other party's PR value, etc., so the search engine generally do not like this type of redirection, so in doing redirect when it is best to get 301 redirect. Strictly speaking with 301 redirect is to avoid SEO cheating, not really SEO optimization.

Let's look at how to implement 301 redirects:

If your server is Windows and is a stand-alone host, then you can set this up:

Open Internet Information Services Manager, and then under virtual directory, select Redirect to URL (u), and then enter the destination URL you want to redirect, and then select permanent redirection of resources to determine.

If your server is Apache, you can use the. htaccess file to achieve redirection:

Just add a similar

Rewriteengine on
Rewritecond%{http_host} ^beijing-seo.com.cn [NC]
Rewriterule ^ (. *) $ http://beijing-seo.com.cn/$1 [l,r=301].

In addition, you can use ASP, PHP,. NET code to achieve 301 redirects:

ASP:

Response.status= "Moved Permanently"
Response.AddHeader "Location", "http://beijing-seo.com.cn/"
Response.End

PHP:

Header ("http/1.1 moved Permanently");
Header ("location:http://beijing-seo.com.cn/");
Exit ();

. NET:

<script runat= "Server" >
private void Page_Load (object sender, System.EventArgs e)
{
Response.Status = "Moved Permanently";
Response.AddHeader ("Location", "http://beijing-seo.com.cn/");
}
</script>

Webmaster Network News list Www.admin5.com/top

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.