Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

I'm trying to get our HAP install to auto redirect to HTTPS so when a user types in our web address they dont have to put https://.

 

I've seen that i can edit the web.config and add the following:

 

        
	
		 
		 
		 
			
		 
		
		   
	
		

 

I've placed this in under the section which is near to the bottom of the web.config. I can get to the root of the web server but i cannot get to HAP as our HAP install is located at http://HTTPS://URL/HAP. When i browse to /HAP i get an error 500 page.

 

If i take out the above code, it it works without any problems.

 

Can someone tell me what im doing wrong and how to auto redirect to HTTPS.

Posted

Hi timbo343,

I have had many issues with this until I went for the easy route of using URL Rewrite (https://www.iis.net/downloads/microsoft/url-rewrite)

 

Set the following settings:

Match URL:

Requested URL: Matches the Pattern

Using: Regular Expressions

Pattern: (.*)

Ignore Case: Tick

 

Screenshot_1.png

 

Conditions

Local Grouping: Match All

ADD...

Condition Input: {HTTPS}

Check if input string: Matched the Pattern

Pattern: ^OFF$

Ignore Case: Tick

OK

 

Screenshot_2.pngAction

Action type: Redirect

Redirect URL: https://{HTTP_HOST}/{R:1}Append Query String: Tick

Redirect Type: See Other (303)

 

Screenshot_3.png

 

APPLY

 

Hope this help,

Thank you

  • Thanks 1
Posted
Hi timbo343,

I have had many issues with this until I went for the easy route of using URL Rewrite (https://www.iis.net/downloads/microsoft/url-rewrite)

 

Set the following settings:

Match URL:

Requested URL: Matches the Pattern

Using: Regular Expressions

Pattern: (.*)

Ignore Case: Tick

 

[ATTACH=CONFIG]40921[/ATTACH]

 

Conditions

Local Grouping: Match All

ADD...

Condition Input: {HTTPS}

Check if input string: Matched the Pattern

Pattern: ^OFF$

Ignore Case: Tick

OK

 

[ATTACH=CONFIG]40922[/ATTACH]Action

Action type: Redirect

Redirect URL: https://{HTTP_HOST}/{R:1}Append Query String: Tick

Redirect Type: See Other (303)

 

[ATTACH=CONFIG]40923[/ATTACH]

 

APPLY

 

Hope this help,

Thank you

 

Many thanks for this. I was going to look at URL Rewrite but never got round to it. You've saved me a heap of time. Many many thanks!

 

Tim

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...