我(wǒ)司雲虛拟主機服務器爲windows服務器,對靜态化的配置表現爲在根目錄下(xià)放(fàng)置httpd.ini(URL Rewrite配置文件).
備注: .htaccess方式爲Unix/Linux服務器所使用的URL Rewrite配置方式..htaccess虛拟主機08系統的是支持的。
注:僞靜态注釋有中(zhōng)文的,保存編碼格式要:ANSI
以下(xià)是常見的通用網站程序的 UrlRewrit 規則,如果您自己寫的網站程序,請讓貴公司的程序員(yuán)根據自己的程序自行
編寫 UrlWrite 規則,Urlwrite規則是用正則表達式編寫的,在編寫時,請注意對正則表達式的特殊字符進行轉義,比
如要将"?"寫成"\?"等。如果貴公司的程序員(yuán)不清楚什麽是正則表達式,請先通過百度搜索并了解什麽是正則表達式再編寫。
1.Discuz.
1).上傳httpd.ini文件到雲虛拟主機根目錄.
httpd.ini文件内容:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)$ $1/archiver/index.php\?$2
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay.php\?fid=$2&page=$3
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread.php\?tid=$2&extra=page\%3D$4&page=$3
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/space.php\?$2=$3
RewriteRule ^(.*)/tag-(.+)\.html$ $1/tag.php\?name=$2
RewriteRule ^(.*)/index-(.+)\.html$ $1/index.php\?gid=$2
RewriteRule ^(這裏填寫您的BBS的安裝目錄,不要帶“/”)/index\.html$ $1/index.php
2).在網站後台打開(kāi)靜态選項:
2.Shopex.
1). 複制以下(xià)内容到httpd.ini文件.
httpd.ini文件内容:
[ISAPI_Rewrite]
#首頁
RewriteRule ^(.*)/index.html $1/index.php
RewriteRule ^(.*)/default.html $1/index.php
#商(shāng)店(diàn)公告
RewriteRule ^(.*)/bulletin.html $1/index.php\?gOo=article_list.dwt&acat=1
RewriteRule ^(.*)/bulletin_([0-9]+).html $1/index.php\?gOo=article_list.dwt&acat=1&p=$2
#商(shāng)品分(fēn)類
RewriteRule ^(.*)/catalog.html $1/index.php\?gOo=goods_category.dwt
#全部商(shāng)品
RewriteRule ^(.*)/list.html $1/index.php\?gOo=goods_search_list.dwt
RewriteRule ^(.*)/list_([0-9]+).html $1/index.php\?gOo=goods_search_list.dwt&p=$2
#會員(yuán)中(zhōng)心
RewriteRule ^(.*)/member.html $1/index.php\?gOo=member_home.dwt
#幫助中(zhōng)心與常見問題
RewriteRule ^(.*)/faq.html $1/index.php\?gOo=help.dwt&acat=2
RewriteRule ^(.*)/faq_([0-9]+).html $1/index.php\?gOo=help.dwt&acat=2&p=$2
#安全交易
RewriteRule ^(.*)/safe.html $1/index.php\?gOo=help_safe.dwt
#購買流程
RewriteRule ^(.*)/howtobuy.html $1/index.php\?gOo=help_buystep.dwt
#如何付款
RewriteRule ^(.*)/howtopay.html $1/index.php\?gOo=help_send.dwt
#聯系我(wǒ)們
RewriteRule ^(.*)/contactus.html $1/index.php\?gOo=help_contact.dwt
#關于我(wǒ)們
RewriteRule ^(.*)/aboutus.html $1/index.php\?gOo=help_copyright.dwt
#顧客留言分(fēn)頁
RewriteRule ^(.*)/feedback.html $1/index.php\?gOo=shopbbs.dwt
RewriteRule ^(.*)/feedback_([0-9]+).html $1/index.php\?gOo=shopbbs.dwt&p=$2
#友情鏈接
RewriteRule ^(.*)/friendlink.html $1/index.php\?gOo=linkmore.dwt
#用戶注冊
RewriteRule ^(.*)/register.html $1/index.php\?gOo=register_1.dwt
#忘記密碼
RewriteRule ^(.*)/lostpass.html $1/index.php\?gOo=forget.dwt
#商(shāng)品詳細頁
RewriteRule ^(.*)/product/([0-9]+).html $1/index.php\?gOo=goods_details.dwt&goodsid=$2
RewriteRule ^(.*)/product_([0-9]+).html $1/index.php\?gOo=goods_details.dwt&goodsid=$2
RewriteRule ^(.*)/([0-9]+)_([^.]*).html $1/index.php\?gOo=goods_details.dwt&goodsid=$2
#新聞詳細頁
RewriteRule ^(.*)/article_([0-9]+).html $1/index.php\?gOo=help_details.dwt&articleid=$2
RewriteRule ^(.*)/message_([0-9]+).html $1/index.php\?gOo=article_details.dwt&articleid=$2
#分(fēn)類詳細列表
RewriteRule ^(.*)/catalog_([0-9]+).html $1/index.php\?gOo=goods_search_list.dwt&gcat=$2
RewriteRule ^(.*)/catalog_([0-9]+)_([0-9]+).html $1/index.php\?gOo=goods_search_list.dwt&gcat=$2&p=$3
#收藏商(shāng)品
RewriteRule ^(.*)/addtofavorites_([0-9]+).html $1/index.php\?gOo=addmembergoods.do&goodsid=$2
#首頁上的新,推薦,特價商(shāng)品
RewriteRule ^(.*)/list_([a-zA-Z]+).html $1/index.php\?gOo=goods_search_list.dwt>ype=$2
RewriteRule ^(.*)/list_([a-zA-Z]+)_([0-9]+).html $1/index.php\?gOo=goods_search_list.dwt>ype=$2&p=$3
2).進入網站後台開(kāi)啓靜态功能.
1.ECShop(V2.7.0).
1). 複制以下(xià)内容到httpd.ini文件.
httpd.ini文件内容:
[ISAPI_Rewrite]
# 爲了确保重寫規則不影響服務器上的其他站點
# 請将下(xià)面的語句前的#号去(qù)掉,并将(?:www\.)?site1\.com改爲商(shāng)店(diàn)所在域名
#RewriteCond %{HTTP:Host} (?:www\.)?site1\.com
RewriteRule ^(.*)/index.html$ $1/index\.php [I]
RewriteRule ^(.*)/category$ $1/index\.php [I]
RewriteRule ^(.*)/feed-c([0-9]+).xml$ $1/feed\.php\?cat=$2 [I]
RewriteRule ^(.*)/feed-b([0-9]+).xml$ $1/feed\.php\?brand=$2 [I]
RewriteRule ^(.*)/feed-type([^-]+)\.xml$ $1/feed\.php\?type=$2 [I]
RewriteRule ^(.*)/feed.xml$ $1/feed\.php [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ $1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6&page=$7&sort=$8&order=$9 [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)\.html$ $1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6 [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html(\?(.*))? $1/category\.php\?id=$2&brand=$3&page=$4&sort=$5&order=$6&$8 [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html(\?(.*))? &nb