apache 配置rewrite模块,URL中隐藏index.php

打开httpd.conf

去掉下面的井号

#LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉 

在网站根目录添加.htaccess

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ index.php/$1 [L] 

重启服务器

 

posted @ 2016-10-09 23:47  xnuwu  阅读(596)  评论(0编辑  收藏  举报