网站首页 | 域名注册 | 云虚拟主机 | 企业邮箱 | 租用托管 | 代理加盟 | 联系我们 | 汇款方式
欢迎您来到客户支持! 全国代理加盟热线:4000-721-000
★常见网站在云虚拟主机上的静态化配置.
点击数:388443更新时间:2016-09-22 15:30

我司云虚拟主机服务器为windows服务器,对静态化的配置表现为在根目录下放置httpd.ini(URL Rewrite配置文件).
备注: .htaccess方式为Unix/Linux服务器所使用的URL Rewrite配置方式..htaccess虚拟主机08系统的是支持的。
注:伪静态注释有中文的,保存编码格式要:ANSI

以下是常见的通用网站程序的 UrlRewrit 规则,如果您自己写的网站程序,请让贵公司的程序员根据自己的程序自行
编写 UrlWrite 规则,Urlwrite规则是用正则表达式编写的,在编写时,请注意对正则表达式的特殊字符进行转义,比
如要将"?"写成"\?"等。如果贵公司的程序员不清楚什么是正则表达式,请先通过百度搜索并了解什么是正则表达式再编写。

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 ^(.*)/index\.html$ $1/index.php
RewriteRule ^(这里填写您的BBS的安装目录,不要带“/”)/index\.html$ $1/index.php

2).在网站后台打开静态选项:



2.Shopex.

1). 复制以下内容到httpd.ini文件.

httpd.ini文件内容:

[ISAPI_Rewrite]
#首页
RewriteRule ^(.*)/index.html $1/index.php
RewriteRule ^(.*)/default.html $1/index.php
#商店公告
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
#商品分类
RewriteRule ^(.*)/catalog.html $1/index.php\?gOo=goods_category.dwt
#全部商品
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
#会员中心
RewriteRule ^(.*)/member.html $1/index.php\?gOo=member_home.dwt
#帮助中心与常见问题
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
#联系我们
RewriteRule ^(.*)/contactus.html $1/index.php\?gOo=help_contact.dwt
#关于我们
RewriteRule ^(.*)/aboutus.html $1/index.php\?gOo=help_copyright.dwt
#顾客留言分页
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
#商品详细页
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
#分类详细列表
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
#收藏商品
RewriteRule ^(.*)/addtofavorites_([0-9]+).html $1/index.php\?gOo=addmembergoods.do&goodsid=$2
#首页上的最新,推荐,特价商品
RewriteRule ^(.*)/list_([a-zA-Z]+).html $1/index.php\?gOo=goods_search_list.dwt&gtype=$2
RewriteRule ^(.*)/list_([a-zA-Z]+)_([0-9]+).html $1/index.php\?gOo=goods_search_list.dwt&gtype=$2&p=$3

2).进入网站后台开启静态功能.

 

1.ECShop(V2.7.0).

1). 复制以下内容到httpd.ini文件.

httpd.ini文件内容:
[ISAPI_Rewrite]

# 为了确保重写规则不影响服务器上的其他站点
# 请将下面的语句前的#号去掉,并将(?:www\.)?site1\.com改为商店所在域名

#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(\?(.*))?                                        $1/category\.php\?id=$2&brand=$3&page=$4&$7                                                          [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html(\?(.*))?                                            $1/category\.php\?id=$2&brand=$3&$6                                                                  [I]
RewriteRule ^(.*)/category-([0-9]+)(.*)\.html(\?(.*))?                               $1/category\.php\?id=$2&$4                             [I]
RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)\.html$                                            $1/category\.php\?$4&id=$2&brand=$3

RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html$                                  $1/goods\.php\?id=$2                                 [I]
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$  $1/article_cat\.php\?id=$2&page=$3&sort=$4&order=$5  [I]
RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html$                   $1/article_cat\.php\?id=$2&page=$3                   [I]
RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html$                            $1/article_cat\.php\?id=$2                           [I]
RewriteRule ^(.*)/article-([0-9]+)(.*)\.html$                                $1/article\.php\?id=$2                               [I]
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html   $1/brand\.php\?id=$2&cat=$3&page=$4&sort=$5&order=$6 [I]
RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html                $1/brand\.php\?id=$2&cat=$3&page=$4                  [I]

RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)\.html(.*)$                        $1/brand\.php\?$4&id=$2&cat=$3                  [I]

RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html                         $1/brand\.php\?id=$2&cat=$3                          [I]
RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html                                   $1/brand\.php\?id=$2                                 [I]
RewriteRule ^(.*)/tag-(.*)\.html                                             $1/search\.php\?keywords=$2                          [I]
RewriteRule ^(.*)/snatch-([0-9]+)\.html$                                     $1/snatch\.php\?id=$2                                [I]
RewriteRule ^(.*)/group_buy-([0-9]+)\.html$                                  $1/group_buy\.php\?act=view&id=$2                    [I]
RewriteRule ^(.*)/auction-([0-9]+)\.html$                                    $1/auction\.php\?act=view&id=$2                      [I]
RewriteRule ^(.*)/exchange-id([0-9]+)(.*)\.html$                             $1/exchange\.php\?id=$2&act=view                     [I]
RewriteRule ^(.*)/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ $1/exchange\.php\?cat_id=$2&integral_min=$3&integral_max=$4&page=$5&sort=$6&order=$7 [I]
RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$                         $1/exchange\.php\?cat_id=$2&page=$3&sort=$4&order=$5 [I]
RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)(.*)\.html$                                          $1/exchange\.php\?cat_id=$2&page=$3  [I]
RewriteRule ^(.*)/exchange-([0-9]+)(.*)\.html$                                                   $1/exchange\.php\?cat_id=$2  [I]

2).进入网站后台开启静态功能.

4. Wordpress
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
# Rules to ensure that normal content gets through

RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /wp-(.*) /wp-$1 [L]
# For normal wordpress content, via index.php
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]

5. 301 页面重定向
1). 复制以下内容到httpd.ini文件.

[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32

# 下面的规则表示将 abc.com 域名重定向到 ww.abc.com,请根据你自己的域名自行修改
RewriteCond Host: ^abc\.com$
RewriteRule (.*) http\://www\.abc\.com$1 [I,RP]

6.Win2008系统使用ISAPI_Rewrite3 伪静态

       对于云虚拟主机用户来说,ISAPI_Rewrite3使用中最大的疑惑就是规则文件.htaccess的编写 。其实解决这个问题的办法很简单,用户只需要使用ISAPI_Rewrite3组件中ISAPI_RewriteSyntaxConverter.exe 文件把httpd.ini进行转换,重新重新生成 .htaccess 规则文件。把.htaccess 文件上传到网站跟目录即可是伪静态生效。
 
在cmd中转换格式命令如下:
D:\test>ISAPI_RewriteSyntaxConverter.exe httpd.ini .htaccess
 
如图
客户支持首页
  • 用户常见问题
  • 代理常见问题
  • 域名常见问题
  • 云虚拟主机常见问题
  • 企业邮局常见问题
  • IDC/Vps常见问题
  • 网站备案常见问题
  • 数据库常见问题
  • 400电话常见问题
  • FTP常见问题
  • 营销通常见问题
  • 智能建站常见问题
  • 网站推广常见问题
  • 网站建设常见问题
  • 编程技术文档
  • 可信网站常见问题
  • 行业资讯
  • 热门文章排行
  • 常用文档/协议
  • Windows 2003 上添加/删除FTP用户和网站
  • 域名注册相关基础知识
  • Win9x/Me + PWS构架WEB服务器示例
  • DNS相关知识介绍
  • ★云虚拟主机支持组件一览表
  • 域名解析相关知识
  • 什么是泛域名解析,如何设置
  • 更多... 
    佛山市亿动网络有限公司 www.72e.net (云指)