> 火端搜索程序2.x版偽靜態全新調整了,更簡單的規則,后臺隨時自定義偽靜態規則,不用再手動修改文件。目錄格式還是.html后綴模式有你決定!
~~~
例如:
/k/關鍵詞 后臺應設置 k/{q} 和 k/{q}/{p}
/關鍵詞.html 后臺應設置 {q}.html 和 {q}_{p}.html
/s/關鍵詞.html 后臺應設置 s/{q}.html 和 s/{q}_{p}.html
還可以吧“關鍵詞”base64轉碼,例如:
/5YWz6ZSu6KN.html 后臺應設置 {qe}.html 和 {qe}_{p}.html
~~~
### 簡單設置偽靜態的方法:
> 1、如果你的環境是Apache
請直接移動程序里偽靜態文件夾下的.htaccess文件到根目錄來
> 2、如果你的環境是IIS7.5或者以上版本
請直接移動程序里偽靜態文件夾下的.htaccess文件和web.config到根目錄來
>3、如果你的環境是Nginx
請復制程序里偽靜態文件夾下的nginx.txt文件里面的內容到站點配置文件里,然后重啟Nginx。如下圖:

> 4、如果你的環境是IIS6.0
~~~
請復制程序里偽靜態文件夾下的.htaccess文件和httpd.ini到根目錄來,由于IIS6下偽靜態組件不一樣,不一定支持,建議不要使用Win2003+IIS6這種已經淘汰的環境了。
~~~
**在后臺設置偽靜態規則的時候,建議使用“/”或者“_”這兩個字符來分割,不要用其它特殊字符,以免沖突出錯**
> 2.X的程序里已經包含了偽靜態規則
* Nginx版:
~~~
if (!-e $request_filename) {
rewrite /(.*) /index.php?rewrite=$1 last;
}
~~~
* Nginx版子目錄(/so/):
~~~
if (!-e $request_filename) {
rewrite /so/(.*) /so/index.php?rewrite=$1 last;
}
~~~
* Apache版:
~~~
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?rewrite=$1
</IfModule>
~~~
* Apache版子目錄(請放到/so/文件夾下,注意不是根目錄):
~~~
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /so/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /so/index.php?rewrite=$1
</IfModule>
~~~
* IIS7/8版:
~~~xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true"></requestFiltering>
</security>
<rewrite>
<rules>
<rule name="OrgPage" stopProcessing="true">
<match url="^(.*)$"/>
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(.*)$"/>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="index.php?rewrite={R:1}"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
~~~
* IIS7/8版子目錄(/so/):
~~~xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true"></requestFiltering>
</security>
<rewrite>
<rules>
<rule name="OrgPage" stopProcessing="true">
<match url="^so/(.*)$"/>
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^so/(.*)$"/>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="so/index.php?rewrite={R:1}"/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
~~~
* IIS版,IIS6.0下的httpd.ini:
~~~
[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
RewriteRule ^/sitemap/$ /index\.php\?rewrite=sitemap/
RewriteRule ^/sitemap/(.*).html$ /index\.php\?rewrite=sitemap/$1.html
RewriteRule ^/k/(.*)/(.*)$ /\?q=$1&p=$2
RewriteRule ^/k/(.*)$ /\?q=$1
~~~
* IIS版,IIS6.0下的httpd.ini (/so/):
~~~
[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
RewriteRule ^/so/sitemap/$ /so/index\.php\?rewrite=sitemap/
RewriteRule ^/so/sitemap/(.*).html$ /so/index\.php\?rewrite=sitemap/$1.html
RewriteRule ^/so/k/(.*)/(.*)$ /so/\?q=$1&p=$2
RewriteRule ^/so/k/(.*)$ /so/\?q=$1
~~~
~~~
IIS6.0偽靜態比較麻煩,后臺修改URL格式,需要修改對應的規則,建議IIS6.0環境使用ISAPI_Rewrite3組件,這樣就可以使用Apache的.htaccess規則了
~~~