当前位置:首页 > 服务器技术 > apache

Apache去掉index.php方法

Apache去掉index.php方法 - 文章图片

Apache去掉index.php方法

1、首先打开Apache的httpd.conf配置文件;

Apache去掉index.php方法 - 文章图片

2、然后将mod_rewrite.so模块开启;

Apache去掉index.php方法 - 文章图片

3、再搜索“AllowOverride None”将None改为All。

Apache去掉index.php方法 - 文章图片4、在项目根目录创建.htaccess文件并写入下面代码

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>

以上就是Apache去掉index.php方法的详细内容。


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!