timbo343 Posted January 19, 2017 Posted January 19, 2017 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.
HTCS-SPalmer Posted January 24, 2017 Posted January 24, 2017 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 Conditions Local Grouping: Match All ADD... Condition Input: {HTTPS} Check if input string: Matched the Pattern Pattern: ^OFF$ Ignore Case: Tick OK Action Action type: Redirect Redirect URL: https://{HTTP_HOST}/{R:1}Append Query String: Tick Redirect Type: See Other (303) APPLY Hope this help, Thank you 1
timbo343 Posted January 24, 2017 Author Posted January 24, 2017 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now