asp.net response.redirectpermanent () Make 301 permanent turn

Source: Internet
Author: User

ASP tutorials. NET 4.0 includes a series of new run-time features that are optimized for SEO tutorials for Web site optimization. The previous article has said: Page.metakeywords and Page.metadescription properties and asp.net tutorial Web Forms urlrouting.


Response.redirectpermanent () can be used to make an HTTP 301 permanent redirect.
*.html/*.htm static file is 404 ext. 200, then 301.

private void Page_Load (object sender, System.EventArgs e)
{
Response.Status = "Moved Permanently";
Response.AddHeader ("Location", "news/" +request.querystring["id"]+ ". html");
}

Here is a talk about using the new features-response.redirectpermanent () method for SEO site optimization.

Over time, moving Web pages and other content between Web applications is extremely common, and the site's page address changes can lead to the accumulation of failed links. This will lead to search engine included the link address, the user's collection of address invalidation, the original page accumulated PR value, ranking lost and so on. We will think of using HTTP status Code 301, 302 to achieve page jump to solve the problem.

Prior to ASP.net 4.0, although there is a Response.Redirect () method, the resulting HTTP 302 Jump (302 represents a temporary shift to temporarily moved) can cause an extra HTTP round-trip when the user attempts to access the old URL. In addition, search engines generally do not follow multiple jumps, which means that using a temporary turn will negatively affect your page rankings. Write your own code to achieve 301 jump more trouble.

ASP.net 4.0 has improved this by introducing the Response.redirectpermanent () method, which can be used to make an HTTP 301 Permanent

redirect. This causes the search engines and other user agents that recognize permanent redirection to save and use the new URLs associated with the content. This will make your content indexed and your search engine page rankings improved.

There are similar codes in asp.net mvc earlier: Response.redirecttoroute (string routename) and Response.redirecttoroutepermanent (string Routename) helper method that can be used to make temporary or permanent redirection through the URL-oriented engine. It is now used in ASP.net 4.0 Web forms.

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.