第一步:开启apache重写模块 重启apache

LoadModule rewrite_module modules/mod_rewrite.so
第二步:在项目根目录与入口文件同级的目录重写分布式配置文件.htaccess

内容如下:
Options +FollowSymlinks RewriteEngine On #分布式配置文件 隐藏入口文件 RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
或者
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) index.php/$1效果如下:
