这本地是可以的没什么问题,可是传到服务器时总是不行,解决方法:
第一步先设置路由
Config.php
‘URL_CASE_INSENSITIVE’ => true, //url不区分大小写
‘URL_MODEL’ =>2,
第二步:配置.htaccess
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
第三步:Apache http.conf 启用 rewrite
LoadModule rewrite_module modules/mod_rewrite.so
AllowOverride None 将None改为 All
一般这样就完事了。