PbootCMS內(nèi)核框架采用單入口pathinfo方式,因此所有地址的訪問默認(rèn)都帶有index.php。 去除方法:要去除它很簡單,只要開啟偽靜態(tài)即可,具體偽靜態(tài)規(guī)則如下: 1、IIS7+環(huán)境(IIS6的環(huán)境自行百度):1)安裝rewrite組件,如果使用空間一般空間商默認(rèn)已經(jīng)安裝; 2)到后臺配置參數(shù)中開啟偽靜態(tài)開關(guān); 3)在站點目錄建立web.config文件(可到源碼包rewrite目錄下拷貝規(guī)則),規(guī)則內(nèi)容如下: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="reIndex" stopProcessing="true"> <match url="^(.*)$" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> </conditions> <action type="Rewrite" url="index.php?p={R:1}" appendQueryString="true" /> </rule> </rules> </rewrite> </system.webServer> </configuration> 2、Apache環(huán)境1)開啟Apache重寫模塊,具體請百度,如果使用空間一般空間商默認(rèn)已經(jīng)開啟; 2)到后臺配置參數(shù)中開啟偽靜態(tài)開關(guān); 3)在站點目錄建立.htaccess文件(可到源碼包rewrite目錄下拷貝規(guī)則),規(guī)則內(nèi)容如下: <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?p=$1 [QSA,PT,L] </IfModule> 3、Nginx環(huán)境1、到后臺配置參數(shù)中開啟偽靜態(tài); 2、在nginx虛擬主機location配置中添加規(guī)則,規(guī)則如下: location / { if (!-e $request_filename){ rewrite ^/index.php(.*)$ /index.php?p=$1 last; rewrite ^(.*)$ /index.php?s=$1 last; } } 注意:Nginx中如果站點部署在二級目錄,請對應(yīng)修改重寫規(guī)則, 如:二級目錄為test則:rewrite ^/test/(.*)$ /test/index.php?p=$1 last; |
免責(zé)聲明:本站部分文章和圖片均來自用戶投稿和網(wǎng)絡(luò)收集,旨在傳播知識,文章和圖片版權(quán)歸原作者及原出處所有,僅供學(xué)習(xí)與參考,請勿用于商業(yè)用途,如果損害了您的權(quán)利,請聯(lián)系我們及時修正或刪除。謝謝!
始終以前瞻性的眼光聚焦站長、創(chuàng)業(yè)、互聯(lián)網(wǎng)等領(lǐng)域,為您提供最新最全的互聯(lián)網(wǎng)資訊,幫助站長轉(zhuǎn)型升級,為互聯(lián)網(wǎng)創(chuàng)業(yè)者提供更加優(yōu)質(zhì)的創(chuàng)業(yè)信息和品牌營銷服務(wù),與站長一起進步!讓互聯(lián)網(wǎng)創(chuàng)業(yè)者不再孤獨!
掃一掃,關(guān)注站長網(wǎng)微信