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>
上一篇:使用 chkconfig 和 systemctl 命令启用或禁用 Linux 服务的方法
栏 目:Linux
下一篇:Linux下Makefile的automake生成全攻略
本文标题:apache配置php实现单一入口方法
本文地址:http://www.codeinn.net/misctech/43910.html






