IIS ARR設置HTTP跳轉到HTTPS

GUI Version

- Select the website you wish to configure
- In the “Features View” panel, double click URL Rewrite

You will notice there are currently no rules configured for this site. Click “Add Rules…” in the Actions menu to the right of the “Features View” panel

Use the default “Blank rule” and press “OK”.

When editing a rule there are the “Name” field and 4 configuration pull down boxes.

- Enter “Redirect to HTTPS” in the name field.
- Next we will configure the first configuration pull down box called “Match URL”, on the right side of “Match URL” press the down arrow to expand the box.

Within the “Match URL” configuration box we will set the following settings:

Requested URL: Matches the Pattern
Using: Regular Expressions
Pattern: (.*)

We can now edit the next configuration pull down box which is “Conditions”, Press “Add…” to add a new condition to the configuration.

We will configure the condition with the following settings:

Condition Input: {HTTPS}
Check if input string: Matches the Pattern
Pattern: ^OFF$

Press “OK”

You should see your condition in the list of conditions.

For this setting we do not need to configure the “Server Variables” pull down box. Continue onto the “Action” configuration box and pull down the box by selecting the arrow on the right. We will configure the following settings for the “Action” configuration:

Action Type: Redirect
Redirect URL: https://{HTTP_HOST}/{R:1}
Redirect Type: See Other (303)

Press “Apply” then press “Back to Rules”

You should now see the rule configured on the main screen of the URL Rewrite module.

Test your site, it should now redirect from HTTP to HTTPS.

If we exam the web.config file we can see where the rule was entered. If we entered the rule directly into the web.config file it would show up in the GUI.

Web.Config Rule

You can also edit the web.config file of the site directly and you will be able to see the rule in the GUI. You will need to enter the following within the <system.webServer> </system.webServer> elements.

<rule name="Redirect to HTTPS" stopProcessing="true"><match url="(.*)" /><conditions><add input="{HTTPS}" pattern="^OFF$" /></conditions><action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" /></rule>

When implementing this solution you need to make sure to use relative paths for all references on your page because there is a possibility you will get a warning asking you if you want to display secure and insecure items. For example, if you have a logo on your page and the URL to this logo is http://domain/images/logo.jpg, do not use the whole path because including the http:// will hard code this image to use http and not https. Instead use /images/logo.jpg.

原文地址: http://www.jppinto.com/2010/03/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0/

轉載于:https://www.cnblogs.com/niusys/p/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/259597.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/259597.shtml
英文地址,請注明出處:http://en.pswp.cn/news/259597.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

2013.7.15DAY2

今天自己做了炸土豆 吼吼~ 才知道雞蛋和小麥粉一起弄成漿糊涂到土豆條上炸效果很好~不過做失敗了一些啦 失敗的就用青椒炒著吃。。。。 下午準備做冰品來著。。。結果快遞都到了特別忙。。。就只弄了杯冰啤酒。。。 虐了兩道水題&#xff0c;貼上代碼。。過于水了。。。 Descri…

AutoCAD.NET API 最新(2012)教程下載及在線視頻教程DevTV

Autodek最近發布了基于最新版的AutoCAD 2012的.net API開發教程。基本內容包括&#xff1a; Overview of .NETPlugin BasicsUser InteractionDatabase fundamentalsDictionariesUser InterfaceEventsInputPoint MonitorJigs現在就可以從AutoCAD開發者中心下載&#xff0c; 看圖…

inherits java_JAVA內部類和組合的區別

Why inner classes?At this point you’ve seen a lot of syntax and semantics describing the way inner classes work, but this doesn’t answer the question of why they exist. Why did Sun go to so much trouble to add this fundamental language feature? Feedbac…

SQL Server里一些未公開的擴展存儲過程

SQL Server里一些未公開的擴展存儲過程 [轉帖] 博客天地 www.inbaidu.comSQL Server里一些未公開的擴展存儲過程 擴展存儲過程&#xff08;xp&#xff09;是直接運行在SQL Server地址空間里的動態鏈接庫&#xff0c;是通過使用SQL Server開放數據服務API&#xff08;SQL Server…

Linux技巧:一次刪除一百萬個文件最快方法

昨天&#xff0c;我看到一個非常有趣的刪除一個目錄下的海量文件的方法。這個方法來自http://www.quora.com/How-can-someone-rapidly-delete-400-000-files里的Zhenyu Lee。 他沒有使用find 或 xargs&#xff0c;他很有創意的利用了rsync的強大功能&#xff0c;使用rsync –de…

install python_python install on windows 10

圖 1官網2、下載安裝包&#xff1a;圖 2 Downloads – windows圖 3選擇版本圖 4選擇離線安裝版本圖 5保存下載文件—文件名自己可以修改可能有人看到windows 幾個版本&#xff0c;對幾個版本有迷惑的地方&#xff0c;解釋圖 6幾個版本的差異說明文字解釋&#xff1a;An e…

iOS開發常見錯誤

錯誤1&#xff1a; 1.1這種錯誤都是storyboard有問題 解決&#xff1a;當前storyboard的Custom Class是MJViewController&#xff0c;代碼中MJViewController繼承自UITableViewController。 而storyboard目前提供的是UIViewController&#xff0c;并沒有為MJViewController提供…

windows bat 批處理 !vm 合并快播文件

今天簡單的寫了一個bat批處理文件 用來處理快播的p2p的文件&#xff0c;一般回事這樣的目錄 你可以下載如下代碼 echo off for /r %%a in (.) do (echo %%acd %%acopy /b *.!mv test.rmvb ) pause保存為merge.bat&#xff0c;就可以執行了 代碼解釋&#xff1a; 掃描該目錄下的…

sso接口的調用

之前一直想sso接口已經寫好了&#xff0c;登錄注冊功能是怎么調用的呢&#xff1f;原來在登錄注冊的jsp頁面實現的接口的調用&#xff0c;頁面的校驗和驗證功能在jsp頁面即可實現。 注冊頁面&#xff1a; <% page language"java" contentType"text/html; cha…

java js獲取css方法_5種JavaScript和CSS交互的方法

原標題&#xff1a;5種JavaScript和CSS交互的方法隨著瀏覽器不斷的升級改進&#xff0c;CSS和Java之間的界限越來越模糊。本來它們是負責著完全不同的功能&#xff0c;但最終&#xff0c;它們都屬于網頁前端技術&#xff0c;它們需要相互密切的合作。我們的網頁中都有.js文件和…

(轉)Http協議經典詳解

轉自&#xff1a;http://blog.csdn.net/gueter/archive/2007/03/08/1524447.aspx Author :Jeffrey 引言 HTTP 是一個屬于應用層的面向對象的協議&#xff0c;由于其簡捷、快速的方式&#xff0c;適用于分布式超媒體信息系統。它于1990…

CentOS 同步時間

來源&#xff1a;http://www.ctusky.com/16/0497/ 用date查看系統當前時間&#xff0c;date -R 可查看時區。 CentOS 同步時間由ntp服務提供&#xff0c;可以用"yum install ntp -y"安裝. 裝完后運行命令 ntpdate cn.pool.ntp.org同步時間&#xff0c;然后hwclock -w…

[逆向][Writeup]ISG2015 flagfinder - .NET程序逆向

這個題目同樣是一道.NET的逆向題&#xff0c;.NET的逆向方法在之前的博文中已經介紹過&#xff0c;這里不做重復的說明。本題的源程序可以在我的github上下載&#xff1a;https://github.com/gsharpsh00ter/reverse 0x01 逆向 flagfinder為.NET編譯的PE文件&#xff0c;用dnSpy…

spring是如何管理 事務的

Spring提供的事務管理可以分為兩類&#xff1a;編程式的和聲明式的。編程式的&#xff0c;比較靈活&#xff0c;但是代碼量大&#xff0c;存在重復的代碼比較多&#xff1b;聲明式的比編程式的更靈活方便。 1、傳統使用JDBC的事務管理 以往使用JDBC進行數據操作&#xff0c;使用…

java 編譯原理 字符串_Java編譯原理(javac)

Java中的編譯分為兩個部分&#xff1a;源碼文件編譯成字節碼文件(前端編譯)字節碼文件被虛擬機加載以后編譯成機器碼(后端編譯)對于開發來說接觸的一般都是第一個步驟也就是源碼編譯成字節碼文件(class文件)&#xff0c;第二個步驟開發幾乎不會接觸&#xff0c;因為這是虛擬機在…

sql2012一段時間無法連接報53錯誤

2019獨角獸企業重金招聘Python工程師標準>>> 解決方案 在sqlserver網絡配置下的msqlserver協議下改將ip3改成如下圖所示 轉載于:https://my.oschina.net/u/2511906/blog/840373

ICE第三篇------一些疑難點

1 間接代理 參考http://blog.sina.com.cn/s/blog_53e8499c0100lkoo.html IceGrid用于支持分布式網絡服務應用&#xff0c;一個IceGrid域由一個注冊表&#xff08;Registry&#xff09;和任何數目的節點(Node)構成。注冊表&#xff08;Registry&#xff09;和節點(Node)一起合作…

windows phone 8 使用頁面傳對象的方式 實現頁面間的多值傳遞

在做windows phone 開發的時候&#xff0c;會經常碰到頁面間之間的跳轉和傳遞數據&#xff0c;如果傳遞的值不多&#xff0c;只有兩三個&#xff0c;我們通常使用NavigationService.Navigate(new Uri("頁面名? Name“”&ID“ ”, UriKind.Relative)); 要是碰到要傳遞…

php生成圖片驗證碼代碼,PHP生成圖片驗證碼以及點擊切換的代碼

這篇文章主要介紹了PHP生成圖片驗證碼實例,同時介紹了點擊切換(看不清&#xff1f;換一張)效果實現方法,需要的朋友可以參考下這里來看下效果:現在讓我們來看下 PHP 代碼<?php session_start();function random($len) {$srcstr "1a2s3d4f5g6hj8k9qwertyupzxcvbnm&quo…

python 時間日期處理

refer to : http://www.wklken.me/posts/2015/03/03/python-base-datetime.html#datetime-string http://www.cnblogs.com/65702708/archive/2011/04/17/2018936.html http://www.runoob.com/python/python-date-time.html 轉載于:https://www.cnblogs.com/qingyuanjushi/p/640…