iis 伪静态设置

2023-05-16

1、将下载的 IIS Rewrite 组件解压,放到适当的目录(如 C:Rewrite)下。

 iis 伪静态设置

 

2、在“IIS管理器”里选择网站,右键,属性。

 iis 伪静态设置

3、选择“ISAPI”,点击“添加”。

 iis 伪静态设置

4、填入筛选器名称,如“rewrite”。

 iis 伪静态设置

5、可执行文件下方点击“浏览”,选择刚才解压的Rewrite组件位置,Rewrite.dll。

 iis 伪静态设置

6、确认选择正确后,点击“确定”。

 iis 伪静态设置

7、点击“确定”,完成筛选器添加。

 iis 伪静态设置

8、重启IIS。

 iis 伪静态设置

 iis 伪静态设置

9、重启IIS后,再次选择站点,右键,属性,看到如下所示向上的绿箭头,说明 IIS Rewrite 成功添加并运行。

 iis 伪静态设置

IIS Rewrite 规则设置

解压后的 IIS Rewrite 组件目录(如 C:Rewrite)中,有一个 httpd.ini 文件,将相应规则写入到这个文件中即可。

 

1. 安装重写插件Rewrite.dll 

如果你的 IIS 服务器加载过 Rewrite.dll 则可以不用下载。 

Rewrite.dll文件:http://blog.hxxsh.com/UploadFiles/2006-10/1013525016.rar 

加载 Rewrite.dll 

在 IIS 的 Isapi 上添加筛选器 

筛选器名称为:re 

可执行文件选择 Rewrite.dll 就可以了! 

2. 配置 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/([a-z0-9-]+.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 ^(.*)/profile-(username|uid)-(.+?).html$ $1/viewpro.php?$2=$3 

  

以上是 Discuz!官方提供的配置代码,注意正则格式。 

3. 应用 
比如,将read.php?bl_id=123&bu_id=456 伪静态成 /html/123/456.html 

可以这样写: 

RewriteRule ^(.*)/html/([0-9]+)/([0-9]+).html$ $1/read.php?bl_id=$2&bu_id=$3 点击收藏:“IIS下下伪静态html(URL Rewrite)设置方法”

要使你的IIS服务器支持伪静态重写,按以下步骤来:

1. 安装重写插件Rewrite.dll

如果你的 IIS 服务器加载过 Rewrite.dll 则可以不用下载。

加载 Rewrite.dll

在 IIS 的 Isapi 上添加筛选器

筛选器名称为:re

可执行文件选择 Rewrite.dll 就可以了!

2. 配置 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/([a-z0-9-]+.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 ^(.*)/profile-(username|uid)-(.+?).html$ $1/viewpro.php?$2=$3


以上是 Discuz!官方提供的配置代码,注意正则格式。

3. 应用
比如,将read.php?bl_id=123&bu_id=456 伪静态成 /html/123/456.html

可以这样写:

RewriteRule ^(.*)/html/([0-9]+)/([0-9]+).html$ $1/read.php?bl_id=$2&bu_id=$3


PW的规则:[ISAPI_Rewrite]
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$2

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

iis 伪静态设置 的相关文章

随机推荐

  • 关于华硕X205TA安装Linux操作系统的问题

    便携 廉价 续航长 键盘手感好成为很多人选择华硕这款上网本的最好理由 对于我而言 xff0c Atom Z3735F加上2G内存用来跑跑编辑器 浏览网页 整理文件是完全够用了 由于刚好需要学习学习Linux操作系统 xff0c 我设置好BI
  • 形参与实参

    形参变量 xff1a 形参变量是功能函数里的变量 xff0c 只有在被调用的时候才分配内存单元 xff0c 调用结束后立即释放 所以形参只在函数内部有效 实参变量 xff1a 实参可以是常量 xff0c 变量 xff0c 表达式 xff0c
  • 岁月划过生命线(我的2013-大二.上)

    岁月划过生命线 大二 上 又一次大清早被红马甲查赶出被窝 xff0c 让哥光着屁股就跑到隔壁宿舍去了 xff0c 真心恨死他们 这是一篇最早写于 2013 11 26 日的日志 xff0c 通过后来不断地增删改 xff0c 来总结 xff0
  • 前端与产品经理配合

    产品经理PM职业介绍 如何构建原型图 axure软件
  • 如何分析算法的运行时间(以插入排序为例)

    一个算法在特定输入上的运行时间是指执行的基本操作或步数量 简单来说就是执行每行 xff08 xff09 伪代码所需演的时间 xff08 xff09 接下来看下面这段伪代码 行代码代价次数1for j 61 2 to A lengthn2ke
  • org.mybatis.spring.MyBatisSystemException ResultMap、ResultType、ParameterMap、ParameterType

    报错信息 xff1a org mybatis spring MyBatisSystemException nested exception is org apache ibatis reflection ReflectionExceptio
  • 生产者与消费者问题(C语言 超详细全)小白可入

    include lt stdio h gt include lt pthread h gt pthread create 函数的头文件 include lt windows h gt sleep的头文件 define N 10 define
  • 深入理解Spring的@Order注解和Ordered接口

    前言 Spring的 64 Order注解或者Ordered接口大家都知道是控制顺序的 xff0c 那么它们到底是控制什么顺序的 xff1f 是控制Bean的注入顺序 xff0c 还是Bean的实例化顺序 xff0c 还是Bean的执行顺序
  • Ubuntu开机无桌面图标

    新安装了Ubuntu 16 04 xff0c 执行 sudo apt span class token operator span get update sudo apt span class token operator span get
  • centos7 无法启动网络(service network restart)错误解决办法

    centos7 无法启动网络 service network restart 错误解决办法 以下方法均为网上COPY 同时感谢原博主分享 systemctl status network service 出现以下错误 rtnetlink a
  • Android项目中@BindView的使用

    Android项目中 64 BindView的使用 第一步 xff1a 添加依赖 找到项目Android项目中的Build gradle xff0c 可以看到项目中有两个这样的文件 xff0c 那么我们要添加的依赖是在build gradl
  • FSL 处理大脑图像(预处理)

    一 TBSS处理数据大致流程 1 经过mriconvert转换之后 xff0c 得到每个被试的4D数据 xff0c b值以及向量 2 fslroi data nodif 0 1 choose a no weighted imaging na
  • 使用C语言编写程序,求10个整数中的最大值

    分析 xff1a 首先我们看到十个整数的时候就知道要 int ar 10 xff0c 这十个数字我们可以直接初始化 xff0c 这里我们用scanf初始化数组 注意下面我是怎么操作的 那么怎么找最大的那一个呢 xff1f 办法有很多 xff
  • 【数学】Frobenius范数

    Frobenius范数简称F范数 xff0c 这个范数是针对矩阵 而言的 xff0c 具体定义可以类比向量的L2 范数 简单来说就是矩阵的每个元素的平方和的开方
  • WinRAR分析

    1 xff0e 样本概况 1 1 应用程序信息 应用程序名称 xff1a WinRAR 6 11 0 MD5值 xff1a F2BD2E3D8B7C7C8EEFA2B28E3280EDA3 SHA1值 xff1a DC2B378B27D1A
  • IntelliJ IDEA License server激活(破解)

    打开idea xff0c 通过help gt Register xff0c 可以看到弹出的对话框 xff0c 选择License server 然后输入address xff1a http idea iteblog com key php
  • (转)5、单体架构

    翻译转帖 原文链接 https herbertograca com 2017 07 31 monolithic architecture 这篇文章是软件架构编年史的一部分 xff0c 这是一系列关于软件架构的文章 在它们中 xff0c 我写
  • win7 iis 安装php

    这里只记录IIS设置部分
  • Ubuntu 20.04 + Xfce + tightenvnc,窗口右上角没有最小化、最大化、关闭按钮

    Ubuntu 20 04 43 Xfce 43 tightenvnc xff0c 窗口右上角没有最小化 最大化 关闭按钮 解决方法 下载 xfwm4 4 14 5 1 amd64 deb 到服务器文件夹 http launchpadlibr
  • iis 伪静态设置

    1 将下载的 IIS Rewrite 组件解压 xff0c 放到适当的目录 xff08 如 C Rewrite xff09 下 2 在 IIS管理器 里选择网站 xff0c 右键 xff0c 属性 3 选择 ISAPI xff0c 点击 添