<rule name="Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(w1.baidu.com|w2.taobao.com|xyw0001.my3w.com)$" />
</conditions>
<action type="Rewrite" url="down2/{R:0}" />
</rule>

df

IIS7 做伪静态比较的简单方便  

.程序方面
只需要设置web.config 就可以了。 .服务器需要安装:URL Rewrite
下载地址:http://www.iis.net/download/URLRewrite
Godaddy 的主机已经安装这个插件。
本地在测试的时候 请查看自己是否安装这个插件。 注意要点
.参数用“()” 括起来 ,使用 {R:}来获得参数
.多个参数中间用 &amp; 分割
.name切记不能写一样 <?xml version="1.0"?> <configuration>
<system.webServer>
<rewrite>
<rules>
<!--把二级域名(或指定的域名) 转到目录下-->

<rule name="Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(w1.baidu.com|w2.taobao.com|xyw0001.my3w.com)$" />
</conditions>
<action type="Rewrite" url="down2/{R:0}" />
</rule>

                <!--301重定向把不带3W的域名 定向到带3W-->
<rule name="Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^haoxinwen.info$" />
</conditions>
<action type="Redirect" url="http://www.haoxinwen.info/{R:0}" redirectType="Permanent" />
</rule>
<!--首页-->
<rule name="rD">
<match url="^$" />
<action type="Rewrite" url="Default.aspx" />
</rule>
<!--产品列表-->
<rule name="rP">
<match url="^product/$" />
<action type="Rewrite" url="ProductList.aspx" />
</rule>
<!--产品列表第几页-->
<rule name="rPL">
<match url="^product/list-([0-9]*).html$" />
<action type="Rewrite" url="ProductList.aspx?page={R:1}" />
</rule>
<!--产品类别列表-->
<rule name="rPT">
<match url="^product/([A-Za-z0-9-]*)/$" />
<action type="Rewrite" url="ProductList.aspx?typeUrl={R:1}" />
</rule>
<!--产品类别列表第几页-->
<rule name="rPTL2">
<match url="^product/([A-Za-z0-9-]*)/list-([0-9]*).html$" />
<action type="Rewrite" url="ProductList.aspx?typeUrl={R:1}&amp;page={R:2}" />
</rule>
<!--产品详细-->
<rule name="rPd">
<match url="^product/([A-Za-z0-9-]*)/([A-Za-z0-9-]+).html$" />
<action type="Rewrite" url="ProductDetail.aspx?typeUrl={R:1}&amp;url={R:2}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

IIS7 伪静态 web.config 配置方法的更多相关文章

  1. IIS7 伪静态 web.config 配置方法【详解】

    IIS7 做伪静态比较的简单方便 1.程序方面 只需要设置web.config 就可以了. 2.服务器需要安装:URL Rewrite 下载地址:http://www.iis.net/download ...

  2. 升级到iis7 的web.config配置

    经典模式或集成模式都识别system.webServers节点 aspnet的isapi分32位和64位 不存在时会报404或403

  3. C# IIS7.0+ Web.Config 配置Session过期时间

    1. 2. 3. <sessionState mode="InProc" timeout="120"></sessionState>

  4. web.config配置详细说明

    (一).Web.Config是以XML文件规范存储,配置文件分为以下格式 1.配置节处理程序声明    特点:位于配置文件的顶部,包含在<configSections>标志中. 2.特定应 ...

  5. Asp.net中的web.config配置

    目录 Asp.net中的web.config配置... 1 一. 配置文件保存位置... 2 二. 配置文件加载顺序... 2 三. 配置文件节点介绍... 3 1. . 3 2. . 5 3. . ...

  6. IIS服务器与web.config配置优化指南

    摘自: http://www.3lian.com/edu/2012/11-13/43890.html .修改IIS最大工作进程数 a. 请考虑以下几点: .每一个工作进程都会消耗系统资源和CPU占用率 ...

  7. Web.config配置数据库连接

    web.config配置数据库连接   第一种:取连接字符串 string connString = System.Web.Configuration.WebConfigurationManager. ...

  8. Asp.net Web.Config - 配置元素 caching

    Asp.net Web.Config - 配置元素 caching 记得之前在写缓存DEMO的时候,好像配置过这个元素,好像这个元素还有点常用. 一.caching元素列表   元素 说明 cache ...

  9. asp.net中web.config配置节点大全详解

    最近网上找了一些关于Web.config配置节点的文章,发现很多都写的都比较零散,而且很少有说明各个配置节点的作用和用法.搜索了一下发现有一篇写的不错,这里引用一下 原文地址 http://www.c ...

随机推荐

  1. 在Servlet中获取spring容器WebApplicationContext

    WebApplicationContext springContext = WebApplicationContextUtils.getRequiredWebApplicationContext(ge ...

  2. 二叉树:B+tree等

    二叉树:(树是一种可以递归定义数据结构) 度:节点的个数 深度:层数(即从根点到叶子节点的层数) 满二叉树:指底层叶子节点左右均存在的二叉树. 完全二叉树:指底层叶子节点的右侧均存在的二叉树. 一般二 ...

  3. 今天遇到一个关于栈溢出的问题StackOverflowError

    关于这个问题个人认为是一个比较棘手的问题,因为我们每个人遇到溢出问题的原因都不一样,所以遇到这样的问题就多从问题的根本入手. 我遇到的原因是,循环多次导致的,以为我的俩个互相关联的实体类,当作查询时, ...

  4. 修改权限linux

    1.更改目录所有者命令:chown -R 用户名称 目录名称2.更改目录权限命令:chmod -R 755 目录名称 nginx在不同目录下需要给与全部权限才可以

  5. Invoker-n颜色涂m个珠子的项链

    参考https://blog.csdn.net/anxdada/article/details/76862564. https://blog.csdn.net/baidu_35643793/artic ...

  6. C++进程间通信的十一种方法

    转载: https://www.cnblogs.com/swunield/articles/3893250.html 进程通常被定义为一个正在运行的程序的实例,它由两个部分组成: 一个是操作系统用来管 ...

  7. JavaScript·aJax

    1.ajax 无刷新数据获取,ajax能且仅能从服务器读取文件 ajax_string ajax_数组 ajax_json ajax_分页 2.ajax原理 ajax请求: 1.创建ajax对象2.连 ...

  8. mysql技巧:按条件筛选,然后替换

    1.按条件筛选,然后替换 select * from phome_ecms_tv where playurl like '%关键词%';update phome_ecms_tv set myorder ...

  9. npm 遇到的坑

    在脚手架方式搭建react项目时,输入命令:npm install -g create-react-app,出现错误: UNABLE_TO_VERIFY_LEAF_SIGNATUREUNABLE_TO ...

  10. frag

    <?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android=&qu ...