1

I've looked at innumerable resources on how to set up a HTTP to HTTPS Redirect, but still it doesn't seem to work. Using IIS10 and the URL Rewrite module, here are my steps:

  1. I've generated a Self-Signed SSL Cert (this part is self-explanatory and I feel like it doesn't need attention)
  2. I've added a new binding to port 443 for HTTPS and told it to use the cert generated in step 1.
  3. I've set my rules as in the picture below.

Redirect rule

Browsing to that page gives the generic IIS 'internal error' message. IIS logs say it's a 404 error when trying to access the IP at the default port 80. Going directly to port 443 works fine, it just won't automatically redirect. I'm not really sure what I'm doing wrong here.

It may be worth considering that I'm using PHP, but I don't think that affects anything in this case.

  • 1
    You used the word "rewrite" in your title and tags when you meant "redirect". A redirect changes the URL while the rewrite shows the content from a different URL (on the same host) at the current URL. I'm not very familiar with IIS, but I think that you "action type" of "Rewrite" may be part of the problem. I think you are mis-using the terminology there too. – Stephen Ostermiller Nov 16 '18 at 16:30
  • @StephenOstermiller You make good points. Changing the action type to redirect fixed one of my issues. I am still having another issue with redirecting to a non-standard port number. Is this worth opening up a new question for, or should I just edit this one to fit the new question? – Maclain Anderson Nov 16 '18 at 16:46
  • You can edit this one. Please edit the title too. – Stephen Ostermiller Nov 16 '18 at 17:08
1

The problem appears to be fixed. My only issue was making it a rewrite instead of a redirect, which Stephen Ostermiller helpfully pointed out are two completely different things.

Though I could swear this wasn't the case not two hours ago, it appears to be working fine now. Closing this out when the site allows me to.

  • Did this also solve the "non-standard port" issue? Although your question seems to be using the standard ports? – MrWhite Nov 17 '18 at 10:50
  • I've tested the non-standard port redirects as well, and they seem to be working fine. – Maclain Anderson Nov 18 '18 at 13:19

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.