how to force https on a specific web alias

phillydog

Senior member
Dec 19, 2001
472
0
0
WIN/2003 using IIS 6

I have my website which runs fine on http.
I have a webalias which I would like to run via https but still have on the same website.
I setup SSL so that now my main website can be accessed via http or https, so that my new alias can use SSL, but I would like to prevent people who are going to be logging in on that one webalias to only using https.

Without creating a new website on IIS for that alias, is there anyway to accomplish what I am seeking?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You need 1 IP for each HTTPS site you want to run.

And from the way you describe your setup, you'll have to disable plain-text HTTP on the whole thing or setup some kind of redirect on the webalias.
 

phillydog

Senior member
Dec 19, 2001
472
0
0
Originally posted by: Nothinman
You need 1 IP for each HTTPS site you want to run.

And from the way you describe your setup, you'll have to disable plain-text HTTP on the whole thing or setup some kind of redirect on the webalias.

I appreciate the suggestion, and I know I need to do a redirect, but trying to find out from you guys HOW to do it.

The only thing I can think of is to parse the URL, and if the host is http, then replace with https and do a redirect, but I'd rather have it in the web server itself.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
With Apache you could probably just use mod_rewrite, but I have no clue about IIS.
 

phillydog

Senior member
Dec 19, 2001
472
0
0
Asking a few IIS gurus, I was informed that I can make a website either HTTP, HTTPS, or both, but not a specific webalias.

My workaround was to use the following javascript in the head section:


if (location.protocol=='http:') {
document.location="https://"+location.hostname+location.pathname;
}