0

I have a FQDN and a cname

I want to route all traffic that hits the server (either by cname or FQDN) to

https://fqdn

But if I do this with a URL redirect in IIS 8, I get a "too many redirects" error.

What would be the best way to go about this? Or to have both cname and FQDN trusted. Would URL rewrites be better?

Mike Thoma
  • 24
  • 3

1 Answers1

0

The standard redirect in IIS is very basic. Looking at what you posted you have fqdn and cname both being served from the same server. The redirect in IIS doesn't check if the connection is HTTPS and so is continually redirecting your browser until the browser gives up. The only way this wouldn't be happening is if you had configured two different websites in your IIS, one listening on port 80 and the other listening on 443 and configured the IIS redirection at the Port 80 website level.

Install URL Rewrite and you can create a new rule to redirect without creating two websites.

  1. Give the rule a name
  2. Use Pattern (.*)
  3. Add a condition for {HTTPS} matching the pattern ^OFF$
  4. Set the action to Redirect with redirect URL https://fqdn/{R:1}
  5. Tick to append the query string
  6. Adjust the redirect type to be non permanent(e.g. Temporary or See Other)
  7. Apply

For a pictorial (and web.config edit) version of this see http://www.jppinto.com/2010/03/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0/

Garth McCormack
  • 131
  • 1
  • 6