Thinkphp3.2.3,官網自帶的.htaccess檔案内不好使。
環境最好是phpstudy,為新人掃坑!
1.httpd.conf中去掉LoadModule rewrite_module modules/mod_rewrite.so 前面的#号
2.AllowOverride None 修改為了AllowOverride All
3.在config檔案中添加以下配置:
// URL位址不區分大小寫
'URL_CASE_INSENSITIVE' => true,
//REWRITE模式
'URL_MODEL' => 2,
4.根目錄.htaccess如果沒有自己建也可以。
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
Rewritebase /index.php
RewriteRule ^(.*)$ /index.php?/$1 [L]
php5.6以上需添加?5.6以下沒有?