Redirect http://servername/.../... to http://servername.mydomain.com/.../... in IIS6

tenover
tenover used Ask the Experts™
on
I have a machine hosting a website.  Currently users access it by typing in:
http://servername/.../...

I need to configure IIS so that it redirects that to:
http://servername.mydomain.com/.../...

I believe I can do that in IIS 6, but can't seem to figure out how.  Any help would be much appreciated.  Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
What you're looking for is:
Create a new site (so you can test without messing up your current site). Right click and select properties. Select the Home Directory tab. The third radial button on that tab is redirection to a URL.

You'll likely have to make some other modifications to your current Site / DNS to make it all work, but this should get you started on the right path.

Author

Commented:
That would point it to an external site though.  What I'm looking to do is simply add the "domain.com" on to the URL for any visitor who visits the site.  The site still exists on this local server.  I want anyone who types in:  http://servername to be directed to or should I say, I want the URL to automatically reflect the FQDN of http://servername.mydomain.com
This might be a better solution then -

http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Microsoft_IIS/Q_20871879.html 
http://www.experts-exchange.com/M_1663596.html


use javascript:

function redirect(){
  if(location.href == "http://MachineX"){
     location.href = "http://MachineX.OurDomain.com"
  }
}

html:
<body onLoad="redirect()">

javascript can detect the literal url string, so a loop situation will not be created.

11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

create default.asp at root directory and paste following code:

<%
Response.Redirect ("http://domain.domain.com")
%>

Author

Commented:
Just create a blank "Default.asp" page in the root directory of the CURRENT site and paste that code into the page?  Is it going to show that page when someone hits the site?

Author

Commented:
Well, that didn't work...I created a "Default.asp" page and inserted the above code, put it in the .../inetpub/wwwroot folder of the default website, restarted IIS and got a "Page Not Found" when I tried to hit http://servername

There's got to be an easy way to accomplish this.

Author

Commented:
Still need help with this....I created (on a test machine), a default.asp page in the wwwroot directory. When I open the Default.asp file, I just get the code, not a redirect to the FQDN of the default website.  Here's the code.  I just pasted the recommended code into an html doc in MS Expressions and saved it as "Default.asp".  What am I doing wrong?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Page Language="C#" %>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>
<% response.redirect("http://myservername.mydomain.com/homepage.html)" %>
<body>

<form id="form1" runat="server">
</form>

</body>

</html>

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial