问题:
在apache服务器上,tp框架直接访问:域名/控制器/方法 无效。
解决:
REWRITE模式是在PATHINFO模式的基础上添加了重写规则的支持,可以去掉URL地址里面的入口文件index.php,但是需要额外配置WEB服务器的重写规则。
如果是Apache则需要在入口文件的同级添加***.htaccess***文件,
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
知识点:
(1)tp3.2的标准url格式
域名/index.php/模块/控制器/操作
(2)参考文档:http://document.thinkphp.cn/manual_3_2.html#url