I have a small question where my search fu has left me without an answer.
Example situation
I'm owner of the domains "example.org" and "www.example.org"
I want to redirect "example.org" to "www.example.org"
There already exists a website in IIS 8 that handles both domains
What I did?
1. Create an empty folder for a new "website" in IIS 8 called "example.org"
2. Create a new website in IIS 8 with hostname "example.org"
3. Adding a https binding to this new website
4. Configuring the "HTTP Redirect" as follows:
For "Redirect request to this destination" I set the value "www.example.org"
The redirect behaviour is configured to keep the relative path and query intact and to include redirects to subdirecties (there aren't any anyways) and to use a permanent redirect.
What doesn't work?
The redirection works perfectly fine except a small detail: The protocol used for the inbound requests gets dropped.
That means:
Requests to
https://example.org are redirected to
http://www.example.org
We have basically the following scenario:
http --> http
https --> http
My actual question
Is it possible to configure the HTTP redirection to keep the inbound protocol? From my view this should be something so trivial and easy that I don't understand why this doesn't work
http --> http
https --> https
What I tried so far
Google wasn't helpfull at all I found tons of search results about how I can redirect http to https. But that really isn't what I want.
I tried to configure to redirect the requests from "www.example.org" to "https://www.example.org" (See the Step 4 of "What I did?") but then I have opposite of what I had before (everything goes to https)
http --> https
https --> https
I found a similiar question on SO concerning url rewriting
here[
^] but url rewriting isn't really what I try or want.
I already thank you for your assistance ;)
TL;DR
IIS 8, HTTP Redirection, keep protocol (http/https), no helpful search results (so far)