Can PHP web pages optimize, what?

xiaoxiao2021-03-06  20

On the 4th floor

PHP's path can become a static path through technical processing. Clearly, please see: Content Abstract: In addition, as the content on the Internet is increasingly highlighting the importance of search engines, if the website wants to be better subject to search engines, website design except for user-friendly (User Friendly, the design of Search Engine Friendly is also very important. The more the page you enter the search engine, the greater the chance to find by the user with different keywords. In a Google's Algorithm Investigation, a site mentioned by a Site is also affected by the number of Google Indexes. It is also impact on PageRank. Since Google highlights the relatively static part of the entire network (the dynamic web index quantity is relatively small), the link address is relatively fixed, the static web page is more suitable for the Google index (noble, the mail list archive and blog of the big website "and Blog are archived by date. Rong So), therefore many of the forms of using a certain mechanism to become a statistical page parameter to a static web page in the art of search engine URL design optimization (URI PRETTY): such as: http: // phpunixman . Sourceforge.net / index.php? mode = man¶meter = LS becomes: http://phpunixman.sourceForge.Net/index.php/man/ls implementation is mainly two types: ISAPI REWRITE Downloads based on URL Rewriteiis (Free) Based on PATH_INFO to use the URI address as a parameter delivery: URL REWRITE is the simplest system based on the URL converted steering (REWRITE) module in a variety of web servers: so almost no modification of the implementation of news.asp • ID = 234 This link is mapped into news / 234.html, which looks like an outside and a static link. There is a module on the Apache server (non-default): MOD_REWRITE: URL REWRITE function is strong enough to write a book. When I need to map the news.asp? Id = 234 into news / 234.html, just set: shutriterule /news/(/d )/.html /news/.asp/?id= $ 1 [N, I] This will map the request such as /news/234.html into /news.asp?id=234 When there is a request for /news/234.html: The web server forwards the actual request to /news.asp • ID = 234 also has corresponding REWRITE modules in IIS: such as Isapi Rewrite and IIS Rewrite, syntax is based on regular expressions, so configuring almost the same and apache's mod_rewrite is the same: REWRITERULE / NEWS / (/ D ) /. html /news/news/.php/?id= $ 1 [n, i] This will map http://www.chedong.com/news/234.html to http: // Www.chedong.com/news/news.php?id=234 A more common expression of all dynamic pages is mapped in http://www.myhost.com/foo.php?a= A & B = B & C = C behaves to http://www.myhost.com/foo.php/a/a/b/b/c/c.

ReWriterule (. *? /. PHP) (/? [^ /] *) / ([^ /] *) (. ?)? $ 1 (? 2 $ 2 &: /? $ 3 = $ 4? 5 $ 5: [n, i] is really a Apache MOD_REWRITE configuration for PHPBB: MOD_REWRITE and ISAPIREWRITE are basically compatible, but it is still different, such as: IsapiRewrite "?" Need to escape "/ ? ", MOD_REWRITE, ISAPIREWRITE supports" / d "(all numbers), MOD_REWRITE does not support RewriteEngine on shutriterule /forum/topic_(. /.html full /forum/viewtopic.php?t=1 [l] Rewriterule / Forum / forum _ (. ) /. html $ /forum/viewforum.php?f= ** [l] REWRITERULE /FORUM / IR_ (. )/.html / /forum/profile.php?mode=viewprofile&u= $ 1 [ L] You can access the original dynamic page by topic_1234.html forum_2.html user_34.html after setting. There are also some benefits through the URL REWRITE: hidden background: This is very useful when migrating in the background application platform: When moving from the ASP to the Java platform, for the front desk users, the fundamental feelings will not change the background application; simplify the data school Check: Because the parameters such as (/ d ) can effectively control the format or even the number of numbers; such as we need to migrate your application from news.asp? Query = 234, front desk performance It can always be maintained as news / 234.html. Separation from the application and front desk: Maintain the stability of the URL, and use mod_rewrite can even forward the request to other background servers. Another way to beautify the URL of PATH_INFO is based on PATH_INFO: Path_info is a CGI 1.1 standard, often discovered that "/ value_1 / value_2" behind the CGI is also the PATH_INFO parameter: such as http: //phpunixman.sourceforge. Net / index.php / man / ls, in: $ PATH_INFO = "/ man / ls" path_info is the CGI standard, so PHP servlet is supported. For example, there is a request.getpathinfo () method in the servlet. Note: / myapp / servlet / hello / foo getPathInfo () returned / foo, / foo, and /myapp/dir/hello.jsp/foo getPathInfo () will return /HELLO.JSP, from here you can also know JSP In fact, it is a servlet's path_info parameter.

ASP does not support Path_info, PHP-based parameter-based parameters based on PATH_INFO-based parameters are as follows: // Note: Parameters Press "/" Split, the first parameter is empty: from / param1 / param2 to extract $ Param1 $ param2 2 Parameter IF (ISSET ($ _ Server ["Path_info"])) {list ($ Nothing, $ Param1, $ Param2) = EXPLODE ('/', $ _server ["path_info"]);} How to hide applications: For example .php , Extended in Apache: forceType Application / X-httpd-php How to more like static pages: App_name / my / app.html analysis of PATH_INFO parameters , Truncate the last 5 characters of the last parameter ".html". Note: Apache2 is not allowed to pass the PATH_INFO, which requires that AcceptPathInfo ON, especially for the use of virtual host users, no right to install and configure mod_rewrite, path_info tends to be unique. OK, I see the web page similar to http://www.example.com/Article/234 you may be article / show.php? Id = 234 dynamic web page generated by this PHP program, many sites look There may be a lot of static directories, in fact, it is very likely to be published using 1, 2 programs implementation. For example, many Wikiwiki systems use this mechanism: The entire system is a simple Wiki program, and the directory that looks like this is the query result of the next address as the parameter. The original dynamic distribution system is used to modify the original dynamic distribution system using a solution based on mod_rewrite / path_info cache servers. It is convenient for the search engine to enter the index.

转载请注明原文地址:https://www.9cbs.com/read-65336.html

New Post(0)