Solved

Redirect HTTP to HTTPS in Azure

Posted on 2016-10-06
4
54 Views
Last Modified: 2016-10-11
We just installed SSL in our azure website to convert it to HTTPS.

Now we want that any request coming in as HTTP should be changed/redirected to HTTPS connection.

How can I do this?
0
Comment
Question by:SHANCHAT972
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
Alex Smith earned 500 total points
ID: 41832985
you can make it though below instruction.

http://blog.smarx.com/posts/redirecting-to-https-in-windows-azure-two-methods

Need more help please contact.
0
 

Author Comment

by:SHANCHAT972
ID: 41834343
I tried this and it did not work on my server. So I used the simplest rule to test.
Even that did not work.

  </system.webServer>

        <rewrite>
            <rules>
                <rule name="Redirect to HTTPS">
                       <match url="*.*" />
                        <action type="Redirect" url="http://www.google.com"  />
                </rule>
            </rules>
        </rewrite>
  </system.webServer>

Open in new window


Any ideas?
0
 

Assisted Solution

by:SHANCHAT972
SHANCHAT972 earned 0 total points
ID: 41834596
I ended up using this code:

  <system.webServer>
	<rewrite>
		<rules>		
			<rule name="HTTP to HTTPS redirect" stopProcessing="true">
				<match url="(.*)" />
					<conditions>
                        <add input="{HTTPS}" pattern="Off" />
						<add input="{REQUEST_METHOD}" pattern="^get$|^head$" />
					</conditions>
					<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
			</rule>			
		</rules>
	</rewrite>
  </system.webServer>

Open in new window



But now when the website is redirected from HTTP to HTTPS then,

if website was:

http://1.2.3.4/Website1/Pages/Page1.aspx

it switches to

https://1.2.3.4/Pages/Page1.aspx


"Website1" is missing !!!!!


Any ideas .........
0
 

Author Comment

by:SHANCHAT972
ID: 41839287
I used this

<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="SeeOther" />
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Synchronize a new Active Directory domain with an existing Office 365 tenant
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now