. Net implements pseudo-static and its significance, and. net implements pseudo-static

Source: Internet
Author: User

. Net implements pseudo-static and its significance, and. net implements pseudo-static

Use of pseudo-static:

The search engine does not include websites with question marks. Because the search engine is afraid of endless loops due to question marks, it is called the "Search robot trap", many address search engines with question marks will not go in.

For websites with question marks, the search engine will also include them, and the weight is not high.

Pseudo-static is static for search engines. Because there is no question mark in the middle of the address, there is no more true static statement than false static statement.

Why do we choose pseudo-static pinch?

"Discuz! There are currently 2129867 posts, and the size of html stored is about 20799 MB, that is, about 20 GB. This does not count the space waste caused by the disk storage mechanism (the space occupied by 100 1 K files may be 200 K )."

The so-called text forum is similar to the real static statement. It stores data in space, reads and writes a large number of hard disks, and so on.

Deleting the updated html content will result in a large number of disk operations and a large number of disk fragments, and even cause bad sectors on the hard disk.

Disadvantages of pseudo-static

If the traffic is slightly larger, the CPU is overloaded when pseudo-static data is used, because the pseudo-static data uses regular expressions to determine whether it is a real address, the responsibility for displaying the page is determined by the CPU directly. Therefore, the increase in CPU usage is indeed the biggest drawback of pseudo-static.

Should static or pseudo static be used?

1. There is no difference between static and pseudo-static SEO.

2. Using true or static data may cause disk damage and affect the performance of the website forum.

3. Use pseudo-static resources to occupy a certain amount of CPU usage. A large amount of use will overload the CPU.

In general, static is for SEO. Since static is for SEO, it only requires pseudo static to SEO and does not need to be used by users, you only need to use pseudo static data in the Archiver that provides SEO crawling.

 

In fact, the so-called pseudo-static page refers to URL rewriting, which is very simple to implement in ASP. NET.
First, you need to reference two DLL files in your project:
ActionlessForm. dll
URLRewriter. dll
The actual rewrite is URLRewriter. dll. But if you want to implement paging, you must use this ActionlessForm. dll
First, write in web. config

<ConfigSections>
<Section name = "RewriterConfig" type = "URLRewriter. Config. RewriterConfigSerializerSectionHandler, URLRewriter"/>
</ConfigSections>
<HttpModules>
<Add type = "URLRewriter. ModuleRewriter, URLRewriter" name = "ModuleRewriter"/>
</HttpModules>
<! -- The following is the URL rewrite rule -->
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor> ~ /Products/Jurisdiction _ (\ w {3}) \. aspx </LookFor>
<SendTo> ~ /En/Jurisdiction. aspx? Jurid = $1 </SendTo>
</RewriterRule>
<RewriterRule>
<LookFor> ~ /Articles/(\ d {1,}) \. aspx </LookFor> <! -- This is the replaced file name, which uses a regular expression -->
<SendTo> <! [CDATA [~ /En/Article_view.aspx? Article_id = $1]> </SendTo> <! -- This is a webpage to be replaced, generally a webpage with parameters following a question mark -->
</RewriterRule>
<RewriterRule>
<LookFor> ~ /Articles/(\ d {1,}) _ (\ d {1,}) \. aspx </LookFor>
<SendTo> <! [CDATA [~ /En/Article_view.aspx? Article_id = $1 & page = $2]> </SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
For example, the above URL http: // localhost/En/Article_View.aspx? You can use http: // localhost/Articles/9. aspx can be replaced. Of course, you can replace the extension with any extension that can be interpreted by iis. If you prefer to use htm as the extension, configure htm as the extension above the forwarding rule, some articles may also be very long. We usually divide an article into several pages. Based on the above configuration, if we want to access http: // localhost/En/Article_View.aspx? Article_id = 9 & page = 3 we can use http: // localhost/Articles/9_3.aspx instead, so that when the search engine grabs your webpage, you will be included in these URLs. When someone else searches your webpage, they will be able to access these URLs.
Then, perform the following operations:
Right-click my computer --> Manage --> Expand 'services and Applications' --> internet Information Service --> Find the directory you shared --> right-click Properties --> click 'configuration' -->
Ing the following --> Find. aspx executable file path copy path --> paste path --> the extension is ". html "--> then remove the check object check box to check whether the object exists.

Remember to use HttpModule to rewrite the URL.

HTTPModule is used to provide module initialization and event handling. It monitors HttpRequest and adds or filters out some content for HttpRequest. When an HTTPRequest arrives at HTTPModule, the entire ASP. Net Framework system does not process this request. For Http requests, HttpModule is a "must-go" place for an HTTP request ".

Recently, this website uses a pseudo-static component on the web. config. The website root directory contains an http. the INI file uses a regular expression to determine the address, parse the address, and generate a pseudo-static URL.

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.