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.

3
  • 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. Commented Nov 16, 2018 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? Commented Nov 16, 2018 at 16:46
  • You can edit this one. Please edit the title too. Commented Nov 16, 2018 at 17:08

1 Answer 1

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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