Home >Backend Development >PHP Problem >Apache removes index.php method
Apache去掉index.php方法
1、首先打开Apache的httpd.conf配置文件;
2、然后将mod_rewrite.so模块开启;
3、再搜索“AllowOverride None”将None改为All。
4、在项目根目录创建.htaccess文件并写入下面代码
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule>
The above is the detailed content of Apache removes index.php method. For more information, please follow other related articles on the PHP Chinese website!