I have a Windows 2016 server (FQDN: server1.domain) in an Active Directory domain. I am hosting intranet web apps in IIS.
I recently got an alias (FQDN: CoolName.domain) for that server created in the DNS. TLS certificates were generated by the internal certificate authority. Within IIS, I bound port 443 to hostnames CoolName.domain
and CoolName
with the certificate.
I want to be able to redirect my existing apps from the old domain (ie. server1.domain/app1
) to the alias (ie. CoolName.domain/app1
) whenever people type in the old domain. Also force HTTPS if they're using HTTP.
My attempt was using the HTTP Redirect module at the server level within IIS Manager and filled out the following:
Redirect requests to this destination: https://CoolName.domain
Redirect behaviour: Checked Redirect all requests to exact destination (instead of relative to destination)
Then pressed apply.
An image reference of the options I did: https://i.stack.imgur.com/vgPld.jpg
When I visit the following links, they failed to redirect:
http://server1
http://CoolName
http://CoolName.domain
Only http://server1.domain
ended up redirecting to https://CoolName.domain
.
As soon as I tried redirecting any url that went beyond the domain, like http://CoolName.domain/app1
, it doesn't redirect. I tried unchecking the box for Redirect all requests to exact destination (instead of relative to destination) in #2.
Is my requirement possible to do with only HTTP Redirect?