Home > Backend Development > PHP Problem > Apache removes index.php method

Apache removes index.php method

Guanhui
Release: 2023-02-28 21:42:01
Original
5239 people have browsed it

Apache removes index.php method

Apache去掉index.php方法

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

Apache removes index.php method

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

Apache removes index.php method

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

Apache removes index.php method4、在项目根目录创建.htaccess文件并写入下面代码

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

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template