Pseudo-static URL is usually to meet a better SEO results, ThinkPHP support pseudo-static URL settings can be set URL_HTML_SUFFIX
freely 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
'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,
'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:
http://serverName/Home/blog/3.html
http://serverName/Home/blog/3.shtml
http://serverName/Home/blog/3.xml
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:
// 多个伪静态后缀设置 用|分割
'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:
'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 thanURL_HTML_SUFFIX
high to.