【thinkPHP3.1.2】URL四种模式设置

来源:互联网 发布:心知天气api 更改城市 编辑:程序博客网 时间:2024/05/22 00:22

1,thinkPHP3.1.2支持URL四种模式


2,thinkPHP3.1.2支持的默认模式 是pathinfo模式

3,如何设置设置rewrite模式

步骤1:修改apache httpd.conf文件 

        1)LoadModule rewrite_module modules/mod_rewrite.so

        2)

在<Directory  "某路径">

 Options Indexes  FollowSymLinks   ExecCGI

AllowOverride  All  

Order allow,deny

Allow from all

</Directory>



步骤2:在文件根目录和thinkPHP同级


填写



步骤3:更改ThinkPHP\Conf\convention.php

增加 "URL_MODEL"=>"2",

说明:



步骤4:使用方式 使用U()调用, 其中 show是模板或者函数方法,shtml为后缀 


单击 index/show显示效果:




0 0