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] 

重启服务器

原文地址:https://www.cnblogs.com/yangxunwu1992/p/5944292.html