G optimization (SEO) Static Page Implementation Based on Dynamic Pages

Source: Internet
Author: User

Google optimization (SEO) Static Page Implementation Based on Dynamic Pages
China's second-hand market website http://www.2shoushichang.com/chubby post to indicate the source

As we all know, search engines have an exclusive love for static pages, especially Google. Most of our websites are dynamic, generally, dynamic pages are displayed through parameters. Can we generate static pages in a simple way? This is especially difficult for VM users who do not have much space and cannot modify server configurations.
Next, I have personally experienced how to describe in detail the implementation principles and specific practices:
We have taken China's second-hand market as an example.
Second-hand Market in China.
For example, if we want to view all the information about computer classification, need the following connection http://www.2shoushichang.com/BigTypeList.aspx? Id = 100, if you want to see more detailed notebook classification need to open the following connection: http://www.2shoushichang.com/MidtypeList.aspx? Id = 100102. Similarly, if you want to view mobile phone/MP3 information, you need to keep up with different category IDs after the parameter IDs. I think, in classification information, this form accounts for at least 95%. Most other information websites also adopt this method.
However, for spliter, they do not understand the meaning of parameters. Generally, only one or several pages are collected for a single category, and few of them can be fully collected (like Baidu prefers collection ). imagine that if we use another method, for example, for computer classification, we can design the first page as follows:
Bigtype indicates the category, indicating that the category of the information is to be processed, s indicates the sale information, 100 indicates the ID of the Information category (the computer here), and all indicates all regions, 1 represents the first page, so this address represents the http://www.2shoushichang.com/BigTypeList.aspx? An address like id = 100 & page = 1.
Same region? Id = 101100 & City = Qingdao & type = S & page = 3
In this way, we can combine all queries into a fixed address webpage.
Of course, for pages that display information like http://www.2shoushichang.com/Product.aspx? Id = 10864, which can be processed as http://www.2shoushichang.com/product/10864.aspx.
In this way, we can implement static Web pages in almost all the places on our website that require dynamic processing.

It may be said that this is too troublesome. How many webpages do I need to create and how much space do I need !!!
In fact, there is no trouble, no extra space, no real creation of any web page, all your Program Almost no need to move, just add a few lines in global. asax Code That's all.
If you don't believe it, let's continue to elaborate on the specific implementation methods.
We achieve this by capturing user requests and then using rewritepath:
This is a piece of code in my program. It is responsible for converting the above requests into real page requests,
We use regular expressions to differentiate requests of various types:
Protected void application_beginrequest (Object sender, eventargs E)
{
String url = request. url. absoluteuri;
String strmatch = @ "http://www.2shoushichang.com/([^/] + )/";

String newurl = "";
String strcmd = splitinfo (URL, strmatch );
If (strcmd! = NULL)
{
Switch (strcmd. tolower ())
{

Case "product ":
Strmatch = @ "/product/(D +). aspx ";
String strproductid = splitinfo (URL, strmatch );

If (strproductid! = NULL)
{
Newurl = string. Format ("... \ product. aspx? Id = {0} ", strproductid );
This. Context. rewritepath (newurl );
}
Break;

Case "midtype": // s-100100-All-2.aspx
Strmatch = @ "/midtype/(S +-D +-S +-D +). aspx ";
String strresult = splitinfo (URL, strmatch );

If (strresult! = NULL)
{
String [] strparam = strresult. Split ('-'); // midtypelist. aspx? Id = 100100 & City = Weihai & type = S & page = 3
If (strparam. length! = 4)
Break;
String city = appglobal. getcitynamebycode (strparam [2]);
Newurl = string. Format (".. \ midtypelist. aspx? Type = {0} & id = {1} & City = {2} & page = {3} ", strparam [0], strparam [1], city, strparam [3]);
This. Context. rewritepath (newurl );
}
Break;
Case "other processing ":
Break;
Default:
Break;
}

}
}

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.