apache的rewrite模块,在httpd.conf文件中,去掉前面的 #号 ,完毕之后,重启apache
LoadModule rewrite_module modules/mod_rewrite.so
image.png
在入口文件index.php同级目录中,放入一个.htaccess文件(记事本新建文本文件,文件另存为.htaccess)
内容如下:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>









网友评论