服务器之家:专注于服务器技术及软件下载分享
分类导航

云服务器|WEB服务器|FTP服务器|邮件服务器|虚拟主机|服务器安全|DNS服务器|服务器知识|Nginx|IIS|Tomcat|

服务器之家 - 服务器技术 - WEB服务器 - apache配置php实现单一入口方法

apache配置php实现单一入口方法

2021-10-06 15:51服务器技术网 WEB服务器

这篇文章主要介绍了apache配置php实现单一入口方法,大家参考使用

在apache的httpd.conf加入,需要把LoadModule rewrite_module modules/mod_rewrite.so前面的“#”去掉
 

复制代码 代码如下:

DocumentRoot /

 

<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride None
#AllowOverride All
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
#不显示index.php

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule  ^/?(.*)$ /index.php?%{QUERY_STRING} [L,NC]
#RewriteRule ^(.*)$ index.php?$1 [QSA,L]
</IfModule>
DirectoryIndex index.php index.html index.htm
</Directory>

 

延伸 · 阅读

精彩推荐