Static URL, pseudo-static URL, URL rewriting, and static page

Source: Internet
Author: User
Tags website server

Seo friends now know the importance of URL static, URL pseudo static, and URL rewriting to Seo. Search Engines like static website pages. Today, we will analyze in detail the differences among static URLs, pseudo-static URLs, and URL rewriting.

Static URL. Static URL is an existing HTML page on your website server. Each HTML page corresponds to a URL on your website. Common open-source websites that can generate URL static pagesProgramDedecms and other CMS content management systems are available. WordPress can also achieve URL static after installing the plug-in. The difference between static URL and pseudo-static URL is that HTML files need to be generated after static URL. It may take a long time to generate too many files. This is not convenient.

URL pseudo-static . The URL pseudo-state is the most common form of webpage existence. The URL pseudo-static state looks exactly the same as the URL static state, but in fact the file corresponding to the URL does not exist and is implemented by technical means. Pseudo-static has many advantages. For example, if you do not generate realistic HTML files, it will not occupy website space, facilitate management and maintenance, and be as beneficial to Seo as static URLs.

URL rewriting . URL rewriting is a common rewrite technology. It is a type of URL pseudo-static technology and is now widely used in various system environments, such as the most widely used Linux system PHP environment, in addition, the environment is implemented by editing configuration file rules. For example, we often use the rewrite technology to implement 301 redirection in the Linux system PHP environment.

Seo friends must understand URL static and URL pseudo-static settings, which is the basic requirement for Seo sites.




Static Page


Advantages: reduces the pressure on databases and web servers, and provides fast access. Meanwhile, it is helpful for Seo to enable search engines to search for this link.


Train of Thought: "newsdetail. aspx? Id = 101 "dynamically generated web page, download to the custom folder, and rename: 20120319/101. htm. When the user is waiting, the user directly uses htm. The benefits of static pages are now reflected.




String Newpath = ID + ". Htm" ; String Localpath = httpcontext. Current. server. mappath ( "~ /20120319 /" + Newpath ); // Hostingenvironment. mappath (); // Create a folder Directory. createdirectory (path. getdirectoryname (localpath )); WebClient WC = New WebClient (); WC. Encoding = encoding. utf8; // Send a GET request to the server through WebClient to save the HTML content returned by the server to the disk. Later, the user directly requests HTML files. WC. downloadfile ( "Http: // localhost: 7930/newsdetail. aspx? Id =" + Art. ID, localpath );


The a tag of the page can be written as follows: <a href = '2017/<% # eval ("ID") %>. htm'> <% # eval ("title") %> </a>


Notes for static pages:


1. Page encoding: Specify the encoding method for the page to be saved (<meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/> ),


When downloading a webpage from a WebClient, you must pay attention to the encoding.


2. Path: absolute paths are used for images, JS, and CSS.


3. Do not use server controls on the page. Ajax is used for processing.


URL rewriting


The purpose of Static Page and URL rewriting is different. Both URL rewriting and static page can be Seo,


However, it is difficult to develop Seo for URL rewriting. In addition to Seo, static pages can also greatly reduce the load on servers. Only frequently accessed and rarely changed content is made static.


Sample Code


Protected Void Application_beginrequest (Object Sender, eventargs E){
String Url = httpcontext. Current. Request. apprelativecurrentexecutionfilepath; // Obtain the resource you want to access. This attribute obtains the virtual path. // Determine whether the user is accessing the/art/newsDetail-101.aspx format Match match = RegEx. Match (URL, @"~ /Art/newsdetail-(\ D +) \. aspx" ); If (Match. Success) { String Id = match. Groups [1]. value; // Send client requests to other internal pages Httpcontext. Current. rewritepath ( "~ /Art/newsdetail. aspx? Id =" + Id ); } }



To sum up

1. URL rewriting and real static page optimization can be done for Seo, which is no different for search engines.

2. another major reason for static pages is to reduce the load on servers and databases. Static pages are usually non-changing information, such as news, therefore, a system can be statically created into a static page. If there are many interactive pages with the server, the original dynamic page will be maintained. However, Seo can be implemented through URL rewriting.

3. there are also some pages that do not interact much with the server, such as user information pages. Generally, each user generates a static information page. Each time user information is modified, a static page is dynamically generated, then replace the original static page.

4. There are also many problems with generating static pages, not to mention addressing and ing. If there are too many static pages, storage and management are also problems. Therefore, the dynamic and static pages must be analyzed in detail and the optimal solution should be selected.

5. If you only want to do Seo, you can simply rewrite the URL.

6. also ,. net has the page cache technology. This server pressure is similar to generating static pages. For specific technologies, check your own information. (In fact, page cache is a compromise for static pages, but it is limited to storage in the memory and will occupy the memory ).

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: 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.