服务器 
首页 > 服务器 > 浏览文章

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

(编辑:jimmy 日期: 2024/9/20 浏览:3 次 )

在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>

上一篇:win2008 r2 服务器环境配置(FTP/ASP/ASP.Net/PHP)
下一篇:服务器(VPS)安装WebSite Panel面板教程(图文)
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 SiteMap