1)安裝rewrite組件,如果使用空(kōng)間(jiān)一般空(kōng)間(jiān)商默認已經安裝;
2)到後台配置參數(shù)中開(kāi)啓僞靜态開(kāi)關;
3)在站(zhàn)點目錄建立web.config文件(可(kě)到源碼包rewrite目錄下拷貝規則),規則內(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>
1)開(kāi)啓Apache重寫模塊,具體(tǐ)請(qǐng)百度,如果使用空(kōng)間(jiān)一般空(kōng)間(jiān)商默認已經開(kāi)啓;
2)到後台配置參數(shù)中開(kāi)啓僞靜态開(kāi)關;
3)在站(zhàn)點目錄建立.htaccess文件(可(kě)到源碼包rewrite目錄下拷貝規則),規則內(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>
1、到後台配置參數(shù)中開(kāi)啓僞靜态;
2、在nginx虛拟主機location配置中添加規則,規則如下:
location?/?{ ?if?(!-e?$request_filename){ ???? rewrite?^/index.php(.*)$?/index.php?p=$1?last; ???????????? rewrite?^(.*)$?/index.php?s=$1?last; ?} }
*請(qǐng)認真填寫需求信息,我們會(huì)在24小(xiǎo)時(shí)內(nèi)與您取得(de)聯系。