nginx配置中添加(修改)代码:
location / {
try_files $uri $uri/ /index.php?$args;
}
.htaccess添加:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
#RewriteRule .* index.php/$0 [PT,L]
ErrorDocument 404 index.php/error/404
两个RewriteRule似乎都可以,没做更多的测试,适用于隐藏index.php
location / {
}
.htaccess添加:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
#RewriteRule .* index.php/$0 [PT,L]
ErrorDocument 404
两个RewriteRule似乎都可以,没做更多的测试,适用于隐藏index.php