Asp tutorial. net 4.0 includes a series of new runtime features, which is an improvement for seo tutorial website optimization. As mentioned in the previous article, the attributes of page. metakeywords and page. metadegion and the urlrouting of web forms in the asp.net tutorial are described.
Response. redirectpermanent () can be used to perform a permanent http 301 redirect.
*. Html/*. htm static files are converted from 404 to 200, and then to 301.
Private void page_load (object sender, system. eventargs e)
{
Response. status = "301 moved permanently ";
Response. addheader ("location", "news/" + request. querystring ["id"] + ". html ");
}
Here we will talk about using the new feature-response. redirectpermanent () method for seo website optimization.
With the migration of time, it is extremely common to move web pages and other content between web applications. Changes in the page address of a website may lead to the accumulation of invalid links. This will lead to invalid link addresses indexed by the search engine, users' favorite addresses, accumulated PR values on the original page, and lost rankings. We will think of using http status codes 301 and 302 to achieve page Jump to solve the problem.
Before asp.net 4.0, although there is response. the redirect () method, but generates an http 302 jump (302 indicates temporary redirection to temporarily moved). When you try to access the old url, excessive http round-trip occurs. In addition, the search engine generally does not follow multiple jumps, which means that using a temporary turn will negatively affect your webpage ranking. It is troublesome to write code to achieve 301 redirection.
Asp.net 4.0 has improved this by introducing the response. redirectpermanent () method, which can be used to make an http 301 permanent
Redirection. This will lead to identification of permanently retargeted search engines and other user proxies to save and use the new url associated with the content. This will index your content and increase your search engine page ranking.
As early as asp.net mvc, there was a similar code: response. redirecttoroute (string routename) and response. the redirecttoroutepermanent (string routename) auxiliary method can be used to perform temporary or permanent redirection through the url-oriented engine. Now we have used asp.net 4.0 web forms.