1. 如何去掉URL中包含的index.php.

Apache启用mod_rewrite,然后在项目根目录建立.htaccess文件,写入如下内容 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]