Introduction to the 301 redirection in ASP. netg

Source: Internet
Author: User

In the SEO process, 301 turns often play a certain role. Now let's take a look at how to set the 301 redirection in Asp.net.

A simple shift in Asp.net

Response. Redirect ("http://www.0701yt.net"); // create a 302 redirection to the http://www.0701yt.net

Although simple and clear, the 302 redirection (which can be recognized by Google) is very unfriendly to search engines
Only think of it as a temporary connection transfer information, which means its goal can be changed.
Each request. When you need to switch, you need to pass the PR value, increase the search engine friendliness, and drag the old website to the new website, you need to use the 301 redirection. The following is a simple code snippet.

Response. Clear ();

Response. statuscode = 301;

Response. appendheader ("location", "http://www.0701yt.net ");

Response. End ();

301 redirection (or 301 redirection, 301 redirection) is used when the user or search engine requests to the website server.
When a browser request is sent, one of the status codes in the header information (header) returned by the server indicates that the webpage is permanently transferred to another address.

The function is as follows:

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.