|
我按照手册里面的方法写了htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|img|js|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1
所有放在控制器根目录下的控制器可以不带index访问,也就是这个htaccess工作是正常的。
但是对于在子目录下面的控制器就没办法了
比如一个文件在application\controllers\json\account.php 里面有个oauth方法
用 127.0.0.1/index.php/json/account/oauth 可以正常访问
但是用 127.0.0.1/json/account/oauth 就报错
不过在根目录下的是可以访问的
比如 application\controllers\test.php 里的 welcome方法
用 127.0.0.1/index.php/test/welcome 和 127.0.0.1/test/welcome 都能访问 |
|