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

Source: Internet
Author: User
My classmates said that his website was rarely indexed by Google. I studied it and found that the website was basically implemented through dynamic pages + parameters. Of course, such websites are not favored by Google, so I optimized it and changed some code to display information through a virtual static webpage. below is the optimization theory and code:

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 extraordinary passion for static pages, especially Google;
Most of our websites are dynamic. We usually display dynamic pages through parameters, so can we generate static webpages 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 indicates the first page. In this way, this address indicates
Http://www.2shoushichang.com/BigTypeList.aspx? An address like id = 100 & page = 1.
Same example... P; 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, and almost no movement of all your programs, just in global. just add a few lines of code to asax.
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/. 2 shoushichang/. 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.