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. Java设计模式(11)外观模式(Facade模式)

    外观模式(Facade)的定义:为子系统中的一组接口提供一个一致的界面. Facade一个典型应用就是数据库JDBC的应用,如下例对数据库的操作: public class DBCompare { C ...

  2. c++ const 用法总结

    最近第二次学习c++ , 却总是忘记const的一些用法, 所以记录一下笔记 忒困! A: const指针位于 * 的左边 A : const 修饰指针指向的内容, 则内容为不可变量但指针可变: 称其 ...

  3. 【转】【Python】Python网络编程

    Socket简介 在网络上的两个程序通过一个双向的通信连接实现数据的交换,这个链接的一端称为一个Socket(套接字),用于描述IP地址和端口. 建立网络通信连接至少要一对端口号(Socket),So ...

  4. 移动端微信应用开发总结(function ajax meta)

    关键字:document function ajax jquery html5 meta 微信应用开发时,特意把各个容易混淆的知识点和要点,梳理后记录下来,也分享给各位.有问题还请多指正. 一 文档载 ...

  5. [转]Android--多线程之Handler

    原文:http://www.cnblogs.com/plokmju/p/android_Handler.html 前言 Android的消息传递机制是另外一种形式的“事件处理”,这种机制主要是为了解决 ...

  6. nodejs基础 -- 路由

    我们要为路由提供请求的URL和其他需要的GET/POST参数,随后路由需要根据这些数据(URL.GET/POST参数)来执行相应的代码. 因此,需要查看HTTP请求,从中提取出请求的URL及GET/P ...

  7. [2013.7.5新鲜出炉] Ubuntu12.04下载Android4.0.1源码全过程----------------折腾两天,终于下好,附若干问题解决

    本文转至 http://blog.csdn.net/yanzi1225627/article/details/9255457 下载源码这一步折腾了我整整两天,期间遇到很多问题,哎,记录于此,希望日后再 ...

  8. XP远程桌面连接2008提示:远程计算机需要网络级别身份验证,而您的计算机不支持该验证

    原文链接:http://kong62.blog.163.com/blog/static/1760923052011319113044653/ 解决办法: 修改注册表2个地方 开始-运行-regedit ...

  9. HTML5 Canvas 超炫酷烟花绽放动画教程

    这是一个很酷的HTML5 Canvas动画,它将模拟的是我们现实生活中烟花绽放的动画特效,效果非常逼真,但是毕竟是电脑模拟,带女朋友看就算了,效果还是差了点,呵呵.这个HTML5 Canvas动画有一 ...

  10. 8款最新CSS3表单 环形表单很酷

    当我们在网站上注册登录还是提交评论,都需要用到表单,今天我们来分享8款最新CSS3表单,有几个效果很酷很特别,有些也非常实用,一起来看看. 1.CSS3环形特色表单 转圈切换表单焦点 这款CSS3表单 ...