Solved

Redirect HTTP to HTTPS in Azure

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
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…

757 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