John,
Try the following steps:
1. In the IIS MMC right click on the Default Web Site and select Properties.
2. Select the 'Home Directory' tab.
3. Select 'A rediection to a URL'.
4. In the 'Rediect to' field enter: "https://foo.bar.com/exchange" (note
the httpS here).
5. Select 'The exact URL entered above', 'A directory below this one', and
'Apermanent redirection for this resource'.
Now, when browsing to
http://foo.bar.com, you will be redirected to
https://foo.bar.com/exchange.
Please note, that if you add a file name to the original URL for example
http://foo.bar.com/default.htm you will not be redirected, and the request
will bring up the file specified. If you want this to also redirect to
https://foo.bar.com/exchange you should edit default.htm to contain only
the following html code:
<HTML>
<HEAD>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL =https://foo.bar.com/exchange">
</HEAD>
<BODY>
</BODY>
</HTML>
Additionally, requests to files that do not exist can be redirected to
https://foo.bar.com/exchange as well. In the properties of the web site
select the 'Custom Errors' tab and find HTTP Error 404 in the list of error
messages. Select it and click 'Edit Properties'. Set 'Message Type' to
'File' and browse to the file we created with the code above.
At this point all requests will redirect to
https://foo.bar.com/exchange.
Lou Prete [MSFT]
This posting is provided “AS IS” with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.
--------------------
| Content-Class: urn:content-classes:message
| From: "John Ward" <john.l.ward RemoveThis @cgey.com>
| Sender: "John Ward" <john.l.ward RemoveThis @cgey.com>
| Subject: IIS and redirect
| Date: Tue, 20 Jan 2004 15:17:11 -0800
| Lines: 27
| Message-ID: <17b701c3dfab$8837b620$a601280a@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcPfq4g3C3Cx0lDMRxKeh2zgWndsiw==
| Newsgroups: microsoft.public.inetserver.iis
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.inetserver.iis:291551
| NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
| X-Tomcat-NG: microsoft.public.inetserver.iis
|
| I am trying to re-direct the default URL without using
| scripting. Basically after having tried several other
| methods I have put a .htm file in the root of a site and
| have set this as the default document.
| Then I set the file to re-direct to another url, and
| ensure that the client is sent to the exact URL. The
| problem occurs when I doo the following:
|
| http://foo.bar.com/ (default.htm)
|
| redirect to
|
| https://foo.bar.com/exchange/
|
| I have done a netmon trace and what IIS seems to do is
| respond back with
|
| http://foo.bar.com/exchange/
|
| - my only thought is that IIS thinks that as it is the
| same URL it can be lazy...
|
| Help
|
| Cheers
|
| John Ward
| >> Stay informed about: IIS and redirect