URL static
Static has always been one of the most basic SEO requirements, but nearly one or two years of SEO industry on whether it is necessary to do static has a number of conceptual changes.
Why static
Now the vast majority of Web sites are database-driven, the page is generated in real-time by the program, not its on the server has a static HTML file exists. When a user accesses a URL, the program invokes the database data based on the parameters in the URL, generating the page content in real time. Therefore, dynamic pages corresponding to the original state of the URL is also dynamic, including question marks, equals and parameters, such as the following typical forum URL:
3w Point website Point com/viewthread.php?tid=1234&&page=1
Search engines in the early stages of development (2006-2007) are generally reluctant to crawl and ingest dynamic URLs, the main reason is that may be trapped in an infinite loop or a large number of duplicate content, resulting in a great waste of resources. The most typical infinite loop is the perpetual calendar that appears on some websites, many blogs are archived by time, and some hotels, clean class search sites are often the calendar form.
Search engine Spider encounter Perpetual calendar, if keep track of the above link, you can continue to click Next month, next-year, endless into infinite loop, each date corresponding page content is no different. Real users can see this is a calendar at a glance, but the search engine spider face is just a bunch of code, not necessarily can judge it is a perpetual calendar.
Sometimes even if there is no infinite loop, dynamic URLs can cause a large number of duplicate pages.
For example, URL:
3w Point website Point com/viewthread.php?tid=1234&&page=1
and URL:
3w Point website Point com/viewthread.php?page=1&&tid=1234
It's probably exactly the same content. The parameter order in the URL is different from the URL, but the parameters are called, so the content of the page is the same. If the CMS system is poorly designed, these URLs may appear on the site.
More troubling, sometimes some parameters can be any value, the server can return to the page normally, although the content is all the same or very similar. For example, if the above parameter 1234 is changed to 5678 or whatever number, the server will probably also return a 200 status code.
So the previous search engine for dynamic URLs at a distance, to want to site pages are fully included, webmaster need to convert dynamic URLs to static.
How to Static
The most common approach is to use the server's URL rewrite module, the Mod_rewrite module is generally used on the AMP server, and the Windows Server also has modules such as a functionally similar ISAPI. Take the lamp server, for example, to put the URL:
3w Point website Point com/product.php?id=123
Static to:
3w Point website Point com/product/=123
You need to enable the Server Mod_rewrite module, and then write the following code in the. hatccess file:
rewriterule/product/([0-9]+)/product.php?id=$1
URL Rewrite code is based on regular expressions, and the dynamic URL structure of each site is different, and the server settings may be different, and the code will be different. Regular expressions are more complex, ever-changing, and often need to be written by programmers. In writing the URL static code must be very careful, the wrong character, more than a slash and other small differences, can cause disastrous consequences.
Strictly speaking, the URL static here should be called "pseudo-static", that is, the server does not exist the corresponding file, the user access or dynamic generation of the page, but through the URL rewrite technology to make the URL look like static. Also some CMS system can achieve real static, webmaster add product or article, the system will automatically generate a real static HTML file. But for the search engine, the real static and pseudo-static no difference.
Does the URL need to be static?
The search engine has made great progress in crawling dynamic URLs for nearly two or three years. In general, there are two or three parameters in the URL, which will not have much effect on ingest. High-weight domain names, a few more question marks are not a problem. However, in general, it is recommended to be static, both to improve the user experience, but also to reduce the difficulty of inclusion.