As we all know, page static is a necessary skill in the development of portal website, "PHP implementation page static video tutorial" from the pure static and pseudo-static two angle analysis, lead you to learn how to generate a pure static page in PHP, in the Web server How to configure pseudo-static, To help you master yet another pay-raise weapon.
Course Play Address: http://www.php.cn/course/403.html
The teacher's lecture style:
The teacher lively image, witty witty, witty, touching. A vivid image of the metaphor, like the finishing touch, to the students to open the door of wisdom, a proper sense of humor, attracting students to smile, such as drinking a cup of glycol wine, to the aftertaste and nostalgia, the philosopher's motto, culture of the proverbs from time and again interspersed in the middle, give people to think and alert.
The difficulty in this video is that PHP handles pseudo-static:
First, what is pseudo-static:
Pseudo-static aka URL rewrite, is a dynamic URL that looks like a static URL. In other words, dynamic Web pages are implemented to remove the parameters of a dynamic Web page by overriding the URL method, but there is no need to implement a rewritten page in the actual Web page directory.
In addition, two noun resolutions are added
Static URLs: pure static HTML documents, Web pages that can be queried using filetype:htm
Dynamic URLs: Content is stored in the database, according to the requirements of the content, URL in the? # & Show different parameters, such as: news.php? lang=cn&class=1&id=2
Advantages and disadvantages of dynamic, static and pseudo-static (new)
Dynamic URLs
First of all, the dynamic URL for Google, "can not be crawled" is wrong, Google can handle dynamic URLs and smooth crawl, followed by "parameters can not exceed 3" is not correct, Google can crawl parameters more than 3 dynamic URLs, however, To avoid URLs that are too long, you should minimize the parameters.
Secondly, the dynamic URL has its certain advantages, to the above mentioned news.php? lang=cn&class=1&id=2, for example, the URL of the parameters accurately tell Google, this URL content language is CN, is classified as Category 1, Content ID 2, more convenient for Google to identify the content processing.
Finally, the dynamic URLs should be as concise as possible, especially the session ID (SID) and query parameters, which can easily cause a large number of identical pages.
Static URLs
First of all, the absolute advantage of static URLs is its clarity,/product/nokia/n95.html and/about.html can be easily understood, resulting in a relatively high number of hits in search results.
Second, the static URL is not necessarily the best form of the Web site, the dynamic URL said that dynamic URLs can tell Google some of the parameters can be identified, and static URLs if the document is not properly arranged (such as: too flat, the HTML document is placed in the root directory) and other factors, Rather than static URLs for Google to provide a rich reference information.
Finally, does it feel like Google has a hidden meaning in this article? "Updating pages of this type of URLs can be time-consuming, especially if the amount of information is growing fast because each individual page has to change the compiled code." "It's a website, but is there such a problem in Google's system?" he said.
Pseudo static URLs
First, pseudo-static URLs can not make dynamic URLs "static", pseudo-static is only a rewrite of dynamic URLs, Google does not think pseudo-static is an HTML document.
Second, pseudo-static preferable, but should focus on the removal of redundant parameters, canonical URLs, as far as possible to avoid repeating the page.
Finally, pseudo-static has great potential danger, preferably in the site system, website structure, content distribution, parameter meaning familiar with the case of the use.
When writing pseudo-static rules, you should retain valuable parameters and not all the valuable parameters, such as the news.php in the previous example? Lang=cn&class=1&id=2 is best rewritten as news-cn-class1-id2.html, rather than as an excessive refinement rewrite for news-2.html.
And then the pseudo-static must not contain the session ID (SID) and query parameters,/product.asp? sid=98971298178906&id=1234 such a dynamic URL, where the SID would have been recognized and blocked by Google, but if rewritten as/product/98971298178906/1234,google not only unrecognized, It also creates an infinite number of duplicate pages in the entire station (each session will produce a new session ID).
Should we choose pseudo-static or true-static?
1, the use of true static and false static for SEO no difference
2, the use of true static may cause hard disk damage and will affect the performance of the Forum
3, use pseudo-static will occupy a certain amount of CPU share, large use will lead to CPU overload
4, the most important point, we want to static is to SEO
So:
1, the use of true static method can be directly excluded, because no matter how the generation, the hard disk is very hurt.
2, since the authenticity of the static effect of the same, we can choose Pseudo-static.
3, but pseudo-static heavy use will cause CPU overload.
4, so we just do not use a lot of it.
5, since the static just to look at the SEO, we only need pseudo-static to SEO on the line, do not need to give users the use.
6, so we only in the special offer to SEO crawl archiver use pseudo-static on it.
7, thank you for your patience to read the article I wrote.
8, what do not understand the place or have different views welcomed the proposed
Comments on pseudo-static and true-static
The real static and pseudo-static still have the essential difference. In order to browse the user processing a pure HTML and a call to multiple data PHP in the CPU usage significantly less. I remember someone said that HTML download hard disk read and write frequently, he said that it seems to read the database without read and write disk, let alone a lot of cache of scattered PHP is also placed on the hard disk, these read without disk operation? Ridiculous.
Read a single html+ image flash and other accessories can be achieved, why bother to read the database and read the PHP cache file and re-integration of data output and other accessories such as flash pictures so much trouble? CMS home does not need a lot of interaction, forum that set should not get here to use, on the contrary should be more consideration is: beautiful! Compatible! The intuitive information! Performance! There's stability!