PHP pseudo-static writing with code. For example, if this web page www.jb51.netsoft.php1,100,8630.html is actually processing the script, the soft. php parameter is 1,100,863 0, which is equivalent to soft. php? A1c8630 is difficult to remember. Search leads to this webpage
Http://www.jb51.net/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.jb51.net/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 .~)
The compaction http://www.jb51.net/soft.php/1,100,8630.html actually processes the script as soft. php parameter is 1,100,863 0 equivalent to soft. php? A = 1c = 8630 but such a URL is too hard to remember. Search reference...