虛擬主機如何設置偽靜態(tài)規(guī)則
- 來源:縱橫數(shù)據(jù)
- 作者:中橫科技
- 時間:2013/5/8 0:04:30
- 類別:新聞資訊
問:縱橫數(shù)據(jù)得虛擬主機如何設置偽靜態(tài)規(guī)則
答:虛擬主機用戶只需要上傳httpd.ini到web 下自己配置規(guī)則就可以使用了。以下是httpd.ini的書寫例子:
[ISAPI_Rewrite]
RewriteRule ^(.*)/([0-9]+)-(.*)\.html$ $1/product\.php\?id_product=$2 [I]
RewriteRule ^(.*)/([0-9]+)-([a-zA-Z0-9]*)$ $1/category\.php\?id_category=$2 [I]
RewriteRule ^(.*)/([0-9]+)-([a-zA-Z0-9]*)?p=([0-9]+)$ $1/category\.php\?id_category=$1\&p=$2 [I]
RewriteRule ^(.*)/([0-9]+)__([a-zA-Z0-9]*)$ $1/supplier\.php\?id_supplier=$2 [I]
RewriteRule ^(.*)/([0-9]+)_([a-zA-Z0-9]*)$ $1/manufacturer\.php\?id_manufacturer=$2 [I]
RewriteRule ^(.*)/items/([0-9]+).html$ $1/w/index\.php\?p=$1 [I]
RewriteRule ^(.*)/categories (.*)$ $1/w/index\.php\?category_name=$1 [I]
ErrorDocument 404 /404.html
如果您使用的網(wǎng)上下載的開源程序,您可以通過該程序的官網(wǎng)或者百度找到規(guī)則內容,如果您的程序是從個人開發(fā)者手中購買的,如果程序支持偽靜態(tài),也可以要求開發(fā)者給您提供規(guī)則內容。