thinkphp pseudo-static

Pseudo-static URL is usually to meet a better SEO results, ThinkPHP support pseudo-static URL settings can be set URL_HTML_SUFFIXfreely in the final you want to increase the static URL suffix parameter, and will not affect the normal execution of the current operation. For example, we set

  1. 'URL_HTML_SUFFIX'=>'shtml'

Then we can put the following URL  http://serverName/Home/Blog/read/id/1 become http://serverName/Home/Blog/read/id/1.shtml

The latter feature is more static page URL, but having the same URL and the foregoing effect is performed, and does not affect the original parameters.

By default, pseudo-static set html, if we set the pseudo-static suffix is empty,

  1. 'URL_HTML_SUFFIX'=>''

It can support all the static suffix, and will record the current pseudo-static suffix to the constant  __EXT__  , but will not affect the normal page views.

E.g:

  1. http://serverName/Home/blog/3.html
  2. http://serverName/Home/blog/3.shtml
  3. http://serverName/Home/blog/3.xml
  4. http://serverName/Home/blog/3.pdf

It can be a normal visit, if you want to get the current pseudo-static suffix, through constant  __EXT__  get to.

If you want to support multiple pseudo-static suffix can be directly set as follows:

  1. // 多个伪静态后缀设置 用|分割
  2. 'URL_HTML_SUFFIX' => 'html|shtml|xml'

Then, when the access  http://serverName/Home/blog/3.pdf time of the system error will be reported.

You can set prohibit access to the URL suffix, such as:

  1. 'URL_DENY_SUFFIX' => 'pdf|ico|png|gif|jpg', // URL禁止访问的后缀设置

If the access  http://serverName/Home/blog/3.pdf will directly return a 404 error.

Marble platform accuracy class

Note: The
URL_DENY_SUFFIX priority than URL_HTML_SUFFIXhigh to.

 

Guess you like

Origin www.cnblogs.com/furuihua/p/11778114.html