IIS URL Rewrite – Installation and Use

Posted by Nick LeFevre | Leave a reply

IIS URL Rewrite Installation

To get the below URL Rewrite code to work in IIS, you must first install the URL Rewrite module. The URL Rewrite module is not installed by default. The IIS URL Rewrite module may be a better solution than HTTP Redirect in IIS. You can effectively “redirect” from http://domain.com to http://www.domain.com. Of course the URL rewrite has many more uses and features, but we will use it for redirection purposes in this tutorial.

To install the IIS URL Rewrite module: Go Here and click install… Or just click here. Once installed you may need to reboot.

Install IIS URL Rewrite Module

IIS URL Rewrite after Installation

You can double click and make your URL rewrite rule using the interface, or edit the web.config. See below.

IIS URL Rewrite Module

IIS URL Rewrite code in the web.config

IIS URL Rewrite http:// to http://www

<!--web.config url rewrite-->
<system.webServer>
<rewrite>
<rules>
<rule name="RedirectToWWW" stopProcessing="true">
<match url=".*" ignoreCase="true" />
<conditions>
<add input="{HTTP_HOST}" pattern="^domain.com$" />
</conditions>
<action type="Redirect" url="http://www.domain.com/{R:0}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>

Previous to IIS7 this was handled in:

Older IIS URL Rewrite was contained between these tags

<system.web>
</system.web>

The above code can be viewed in the URL rewrite module interface. It’s illustrated below. You may add or modify in either the web.config, or this interface. The main thing is to get it installed, and most likely reboot.

URL Rewrite Rules Interface in IIS

URL Rewrite Interface in IIS

IIS 7 redirect using URL Rewrite

Notice under the “Action” section in the above image there is a selection for “Action type”. Among other choices you can choose Redirect. Choose “Redirect.” Once selected there are then places for you to select “Redirect URL,” and “Redirect type,” such as “Permanent (301).”

Search Terms:
URL Rewrite, URL Rewrite IIS, iis 7 redirect, http://domain.com to http://www.domain.com, IIS URL Rewrite, IIS urlrewrite, URL rewriting, IIS rewrite, rewrite url, urlrewrite, URL Rewrite asp.net, url rewriting asp.net, URL Rewrite module, IIS7 URL Rewrite module, IIS rewrite url, url rewrite tutorial, url rewriting IIS, IIS url rewriting, rewrite IIS, asp url rewrite, IIS7 rewrite, asp.net rewrite url, IIS7 rewrite, IIS redirect url, rewrite url asp.net, IIS url rewrite module, asp.net url rewriting, http redirect, url redirection, IIS redirect.

IIS URL Rewrite – Installation and Use的更多相关文章

  1. IIS URL Rewrite redirect from one Domain to another

    IIS URL Rewrite enables Web administrators to create powerful rules to implement URLs that are easie ...

  2. Windows10中的IIS10安装php manager和IIS URL Rewrite 2.0组件的方法

    Windows10中自带的Server:Microsoft-IIS/10.0,然后这个10却让原本支持组件无法安装了,php manager组件安装时提示“必须安装IIS7以上才可以安装”.那是不是真 ...

  3. IIS URL Rewrite Module防盗链规则配置方法

    IIS版本:IIS 7.5 URL Rewrite组件:IIS URL Rewrite Module(http://www.iis.net/downloads/microsoft/url-rewrit ...

  4. IIS URL Rewrite Module的防盗链规则设置

    IIS版本:IIS 7.5 URL Rewrite组件:IIS URL Rewrite Module(http://www.iis.net/downloads/microsoft/url-rewrit ...

  5. Windows10 IIS安装php manager和IIS URL Rewrite 2.0组件的方法

    Windows10中自带的Server:Microsoft-IIS///8.5/10上安装.微软脑子秀逗,跳过了9,以为能解决版本识别的问题,没想到弄成10,还是出现了版本识别的问题,真是自己打自己的 ...

  6. IIS URL Rewrite(URL 重写)-使用教程

    IIS URL Rewrite(URL 重写)-使用教程 作者:vkvi 来源:千一网络(原创) 日期:2011-8-17  http://www.cftea.com/c/2011/08/9CRXOL ...

  7. IIS:URL Rewrite实现vue的地址重写

    vue-router 全局配置 const router = new VueRouter({ mode: 'history', routes: [...] }) URL Rewrite 1.添加规则 ...

  8. iis url rewrite http->https non-www->www

    <system.webServer> <rewrite> <rules> <rule name="Redirect abc.com to www&q ...

  9. IIS 7.5 使用URL Rewrite模块简单设置网页跳转

    原文 IIS 7.5 使用URL Rewrite模块简单设置网页跳转 我们都知道Apache可以在配置文件里方便的设置针对网页或网站的rewrite,但是最近接手了一组IIS服务器,发现这货简单的没有 ...

随机推荐

  1. Development Tools

    Introduction Even Chris created his article of Useful Reference Books ages ago I just bumped into it ...

  2. Golang (Go语言) Mac OS X下环境搭建 环境变量配置 开发工具配置 Sublime Text 2 【转】

    一.安装Golang的SDK 在官网 http://golang.org/ 直接下载安装包安装即可.下载pkg格式的最新安装包,直接双击运行,一路按照提示操作即可完成安装. 安装完成后,打开终端,输入 ...

  3. Numpy 的ndarray

    创建ndarray 使用array函数 创建一维数组 创建二维数组 并查看有几个列表,每个列表有几个值  查看类型 生成全是0的或者全是1的 具体方法作用

  4. c++ 常用数据类型,命名规则, 不常有数据类型

    1. 常用数据类型 最大值0111111111111111 = 32767最小值1000000000000000 = -32768 short 最低16位 2**7 - 1 负值:反码 int 至少和 ...

  5. 转换基于Maven的Java项目支持Eclipse IDE

    在过去的教程中,使用 Maven 创建了一个Java项目,但是这个项目不能导入到Eclipse IDE中,因为它不是 Eclipse 风格的项目. 这里有一个指南,向您演示如何转换 Maven 生成 ...

  6. HTTP 错误 500.19 配置文件错误 ( 0x8007000d,0x80070032)

    HTTP 错误 500.19 - Internal Server Error无法访问请求的页面,因为该页的相关配置数据无效. 详细错误信息模块 IIS Web Core 通知 未知 处理程序 尚未确定 ...

  7. 【转】C# 异常处理 throw和throw ex的区别 try catch finally的执行顺序(return)

    [转]throw和throw ex的区别 之前,在使用异常捕获语句try...catch...throw语句时,一直没太留意几种用法的区别,前几天调试程序时无意中了解到几种使用方法是有区别的,网上一查 ...

  8. What really happens when you navigate to a URL

    As a software developer, you certainly have a high-level picture of how web apps work and what kinds ...

  9. PHP安全之临时文件的安全

    (一)临时文件简介临时文件,顾名思义是临时的文件,文件的生命周期短.然而,很多应用的运行都离不开临时文件,临时文件在我们电脑上无处不在,通常有以下几种形式的临时文件: 文件或图形编辑程序,所生成的中间 ...

  10. asp.net导出EXCEL的好方法!(好用,导出全部数据)

    1.调用方法: ExportExcel("application/ms-excel", "EXCEL名称.xls", GridView1, this.Page) ...