IIS7 伪静态 web.config 配置方法
<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:}来获得参数
.多个参数中间用 & 分割
.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}&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}&url={R:2}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
IIS7 伪静态 web.config 配置方法的更多相关文章
- IIS7 伪静态 web.config 配置方法【详解】
IIS7 做伪静态比较的简单方便 1.程序方面 只需要设置web.config 就可以了. 2.服务器需要安装:URL Rewrite 下载地址:http://www.iis.net/download ...
- 升级到iis7 的web.config配置
经典模式或集成模式都识别system.webServers节点 aspnet的isapi分32位和64位 不存在时会报404或403
- C# IIS7.0+ Web.Config 配置Session过期时间
1. 2. 3. <sessionState mode="InProc" timeout="120"></sessionState>
- web.config配置详细说明
(一).Web.Config是以XML文件规范存储,配置文件分为以下格式 1.配置节处理程序声明 特点:位于配置文件的顶部,包含在<configSections>标志中. 2.特定应 ...
- Asp.net中的web.config配置
目录 Asp.net中的web.config配置... 1 一. 配置文件保存位置... 2 二. 配置文件加载顺序... 2 三. 配置文件节点介绍... 3 1. . 3 2. . 5 3. . ...
- IIS服务器与web.config配置优化指南
摘自: http://www.3lian.com/edu/2012/11-13/43890.html .修改IIS最大工作进程数 a. 请考虑以下几点: .每一个工作进程都会消耗系统资源和CPU占用率 ...
- Web.config配置数据库连接
web.config配置数据库连接 第一种:取连接字符串 string connString = System.Web.Configuration.WebConfigurationManager. ...
- Asp.net Web.Config - 配置元素 caching
Asp.net Web.Config - 配置元素 caching 记得之前在写缓存DEMO的时候,好像配置过这个元素,好像这个元素还有点常用. 一.caching元素列表 元素 说明 cache ...
- asp.net中web.config配置节点大全详解
最近网上找了一些关于Web.config配置节点的文章,发现很多都写的都比较零散,而且很少有说明各个配置节点的作用和用法.搜索了一下发现有一篇写的不错,这里引用一下 原文地址 http://www.c ...
随机推荐
- 为什么使用zookeeper?
随着应用规模的迅速扩张,单台机器的部署已经难以支撑用户大规模.高并发的请求了, 因此服务化.集群化.分布式概念应运而生. 针对这种场景,人们通常使用的做法就是将软件按照模块进行拆分,形成独立的子系统, ...
- selenium的其他操作
# author=zyqfrom selenium import webdriverimport timedriver=webdriver.Chrome()driver.get('http://ui. ...
- input()和print()函数同时输入输出多个数据--python3
使用input()和print()函数同时输入输出多个数据,需要空格分割输入信息 #!/usr/bin/python3#-*- conding:utf-8 -*- name, age, QQ = in ...
- my first homepage
<!DOCTYPE html><html><head><style type="text/css">p{ text-indent:2 ...
- 北大poj- 1007
DNA排序 逆序数可以用来描述一个序列混乱程度的量.例如,“DAABEC”的逆序数为5,其中D大于他右边的4个数,E大于他右边的1个数,4+1=5:又如,“ZWQM”的逆序数为3+2+1+0=6. 现 ...
- vue+koa实现简单的图书小程序(2)
记录一下实现我们图书的扫码功能: https://developers.weixin.qq.com/miniprogram/dev/api/scancode.html要多读文档 scanBook () ...
- 在VS中连接MySQL
VS没有主动提供那些繁多的连接器,需要的话得自己再安装这些第三方程序包. MySQL为windows平台开发者提供了许多程序包:http://dev.mysql.com/downloads/windo ...
- DPDK- program_guide 2
Data Plane Development Kit(DPDK) RTE_SDK and RTE_TARGET must be configured. ~EAL ~librte_mempool ~li ...
- 安装系统后IP配置问题
1.配置静态IP 在/etc/sysconfig/network-script/ifcfg-eth0 文件,网卡管理文件.修改为静态IP.IPADDR.网关.掩码等 同一台机器上的网卡不能配置在同一网 ...
- 看书记笔记 书名21天学C#
☆:为重点★:为科普△:注▲:术语 前言概述 ☆一门语言必须包括诸如异常处理,无用单元收集,可扩展数据类型以及代码安全性等特征☆C#特性:简单性,面向对象,模块性,灵活性,简明性 ☆C#面向对象的封装 ...