其很简单,按以下步骤操作即可
一、配置.htaccess文件
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
二,修改apache配置文件httpd.conf,找到
<Directory />
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride None
Order allow,deny
Allow from all
Require all granted
</Directory>
修改成:
<Directory />
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
AcceptPathInfo On
Order allow,deny
Allow from all
Require all granted
</Directory>
<Files *.php>
AcceptPathInfo On
</Files>
然后重启apache 就可以了