PHP pseudo-static writing pseudo-static also known as: URL rewriting is mainly generated for SEO. (What is SEO? You don't have to ask me this. Haha ~ If you do not understand SEO, then ~~~~) Pseudo-static
For example, this webpage
Http://www.bitsCN.com/soft.php/1,100,8630.html
In fact, the soft. php parameter is 1,100,863 0.
Equivalent to soft. php? A = 1 & B = 1 = 100 & c = 8630, but such a URL is too hard to remember. Search engines do not like it either.
Real static only completely generates HTML.
Output directly when accessing the client. No script explanation is required. When the traffic is very large (for example, when there are millions of visits each day), it will play a very good effect. That is to say, the server actually has this HTML page.
Of course, when the traffic on your website is not that large. URL rewriting is the best method (in my opinion, server load balancer can be considered when the traffic is high. It also does not matter)
There are many URL rewriting methods, such as APACHE and IISREWRITE. Even PHP scripts can be processed directly. For example, in the above example, PHP scripts are directly processed (the advantage of this method is to directly reduce the pressure on the WEB server when the traffic is high. PS: Also personal opinion:
========================================================== ==========
The following uses a program as an example to describe the PHP pseudo-static program implementation method. In fact, this method has already been released in other forums.
Program example:
Http://www.bitsCN.com/soft.php/1,100,8630.html
The code is as follows:
// Use the server variable to obtain the PATH_INFO information. In this example, it is/, 8630.html, that is, the part after the execution script name.
If (@ $ path_info = $ _ SERVER ["PATH_INFO"]) {
// Regular expression matching parameters
If (preg_match ("// (\ d +), (\ d +), (\ d +) \. html/si", $ path_info, $ arr_path )){
$ Gid = intval ($ arr_path [1]); // get the value 1
$ Sid = intval ($ arr_path [2]); // get the value 100
$ Softid = intval ($ arr_path [3]); // get the value 8630
} Else die ("Path: Error! ");
// Equivalent to soft. php? Gid = 1 & sid = 100 & softid = 8630
} Else die ('path: Nothing! ');
// It's that simple .~)