TP路由重写须要服务器开启URL_REWRITE模块才能支持,服务器开启URL_REWRITE模块以后就能够设置重写,UR重写代码:php
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
URL重写设置成功后,设置网站伪静态:经过设置URL_HTML_SUFFIX参数随意在URL的最后增长想要的静态后缀:html
'URL_HTML_SUFFIX'=>'html' http://www.qiuxue365.cn/zikao/ http://www.qiuxue365.cn/zikao.html
我将我本身的网站www.qiuxue365.cn/zikao/ 修改为www.qiuxue365.cn/zikao.html服务器