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 ...
随机推荐
- js优化总结
避免全局查找 在一个函数中会用到全局对象存储为局部变量来减少全局查找,因为访问局部变量的速度要比访问全局变量的速度更快些 function search() { //当我要使用当前页面地址和主机 ...
- react native获取组件高度,宽 度等
import React,{Component} from 'react'import { View, Text, Image, StyleSheet, TouchableHighlight, Tou ...
- 微信小程序中的小小的遮罩层
<view class='pop_wx_er'> <view>ddddddddddddd</view> <view>ddddddddddddd</ ...
- [转载] Fiddler为所欲为第二篇 像OD一样调试 [二]
首先,如果大家没有看过第一篇,可以先看看第一篇,了解Fiddler script的脚本哦.传送门:https://www.52pojie.cn/thread-854434-1-1.html 导语:其实 ...
- Python_02
Python 判断语句 if,while if ture: print(1) else: print(0) for循环和内嵌函数range() range(a,b,c) a:起始位置 b:终止 ...
- axios学习 - 数据获取及渲染
在app.vue和main.js中引入axios(import axios from 'axios') 基本代码: axios.get('/axios.json') .then(function(re ...
- 【leetcode】485. Max Consecutive Ones
problem 485. Max Consecutive Ones solution1: class Solution { public: int findMaxConsecutiveOnes(vec ...
- 推荐一个免费的在线IDE和终端
墙裂推荐!支持众多语言,方便学习,测试,地址如下 https://www.tutorialspoint.com/codingground.htm
- Jmeter接口测试+压力测试
链接推荐:https://blog.csdn.net/github_27109687/article/details/71968662
- C#实现按键计算器功能
C#实现按键计算器功能 (一次失败的编程) 界面: 代码如下: using System; using System.Collections.Generic; using System.Compone ...