?
Solved

Redirect HTTP to HTTPS in Azure

Posted on 2016-10-06
4
Medium Priority
?
97 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:Arikkan
[X]
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
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
Alex Smith earned 2000 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:Arikkan
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:Arikkan
Arikkan 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:Arikkan
ID: 41839287
I used this

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

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Optimized for private cloud infrastructures and datacenters, Nano Server is minimalistic, yet super-efficient, OS for services such as Hyper-V and Hyper-V cluster. Learn how you can easily deploy Nano Server and unlock its power!
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
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…
Suggested Courses

801 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