Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a site set up under IIS7 that requires SSL.

If the user accesses it by typing in https://www.site.com it comes up but if they type any of the following in the address bar...:

http://site.com
http://www.site.com
site.com
www.site.com

...IIS returns the following error page:

HTTP Error 403.4 - Forbidden
The page you are trying to access is secured with Secure Sockets Layer (SSL).

How do I tweak the settings so that if a user navigates to any of the above that IIS will automatically take them to https://www.site.com ?

Thanks.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Several ways:

The easiest is simply to create a web site bound on port 80 containing only a default page with a meta refresh in the header:

<meta http-equiv="refresh" content="0; url=https://www.site.com/">

A little more complex: install URL rewrite for IIS and configure it to forward all HTTP request to the equvalent HTTPS request. Watch it because you might need to rewrite the host name as well (see this for a simple exemple)

share|improve this answer
1  
The IIS redirect module will work just fine, too. –  Shane Madden Dec 19 '11 at 16:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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