Link to home
Start Free TrialLog in
Avatar of tenover
tenoverFlag for United States of America

asked on

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

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.
Avatar of brandonsteili
brandonsteili
Flag of United States of America image

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.
Avatar of tenover

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of brandonsteili
brandonsteili
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
create default.asp at root directory and paste following code:

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

ASKER

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?
Avatar of tenover

ASKER

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.
Avatar of tenover

ASKER

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>