apache配置php實(shí)現(xiàn)單一入口方法
在apache的httpd.conf加入,需要把LoadModule rewrite_module modules/mod_rewrite.so前面的"#"去掉
DocumentRoot /
Options Indexes FollowSymLinks MultiViews
AllowOverride None
#AllowOverride All
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]
DirectoryIndex index.php index.html index.htm
版權(quán)聲明:
本站所有文章和圖片均來自用戶分享和網(wǎng)絡(luò)收集,文章和圖片版權(quán)歸原作者及原出處所有,僅供學(xué)習(xí)與參考,請勿用于商業(yè)用途,如果損害了您的權(quán)利,請聯(lián)系網(wǎng)站客服處理。