Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Redirect HTTP to HTTPS in Azure

Posted on 2016-10-06
4
69 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
In the market for a new backup solution for Windows Server 2016? Follow these guidelines to get the most bang for your buck.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
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.

829 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