What is the easiest way for me to redirect both http and https from olddomain.com to newdomain.com regardless of invalid certificate warnings?

  • newdomain.com is our current domain on IIS6 and has SSL (with certificate) for some content
  • olddomain.com has a permanent redirect - but this won't
    work for https://olddomain.com. It is a second website in IIS6.

I've had problems researching this because most people are concerned about wildcard SSL certificates or the complexities of multiple SSL host headers for subdomains in IIS6. Warnings seem unavoidable with SSL applied before any redirects can action. Setting up a SSL IIS6 host header just to redirect doesn't seem right (or easy) but perhaps I could change the DNS and/or use an Apache hosting account we have.

Thanks in advance

  • Since the given answers couldn't help point out that an invalid cert is obvious bad practice I thought I should point out why I'm not fussed... Newdomain.com has few users all with our self signed cert installed (we often do it for them) and olddomain.com is about 5 years old. Someone somewhere is using olddomain.com and ignoring the invalid cert and it is messing with our application which is designed to be flexible and use whichever domain lands there. I'm surprised we renewed olddomain.com, its graceful handover period has been and gone. – KCD May 15 '11 at 22:09

First and foremost: Don't train your users to ignore certificate warnings. That is a bad thing. Look into a Subject Alternate Name certificate or just using a different listener address for the old domain.

That said.. you can set up a host header on port 443 in the same way that you'd be doing it if you did have a wildcard or alternate name cert.

Then run this to set up the binding, swapping in the identifier number of a site configured for redirects:

cscript.exe adsutil.vbs set /w3svc/<site number>/SecureBindings ":443:olddomain.com"
| improve this answer | |
  • Thanks. We don't have the admin scripts installed but I believe your approach to support a host header on 443 by editing the IIS configuration outside of its UI is unfortunately the best approach – KCD May 15 '11 at 22:25
  • Found adsutil.vbs under ServicePackFiles\i386 so wasn't difficult, however anyone browsing the IIS Manager UI will never know – KCD May 15 '11 at 22:49
  • 1
    @KCD Yup - it's not possible through the UI. Poor design by Microsoft. – Shane Madden May 15 '11 at 23:29

Within the website properties in IIS 6 there is a redirection setting that can be used to handle the redirection for you. If you're using one IIS entry to serve both the SSL and non-SSL (if any) requests then you can remove the SSL binding and create another website entry with that binding, then enable the redirection there.

As for the warning, that is controlled by the web browser before your redirect settings will be applied. If you want to have an invalid SSL URL redirect to a valid one, then the users will have to go through the process of accepting the invalid certificate before your redirect rule will be executed. If you want that URL to redirect properly, get a valid certificate for a year and let it sit there until users adapt to the change to the new domain.

| improve this answer | |
  • Thanks. I have the redirect working but the challenge is getting IIS6 to match a header value on SSL – KCD May 15 '11 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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