We help IT Professionals succeed at work.

Redirect a domain to another domain/path

I have a web site that I'm closing out the hosting service for and I want to redirect all traffic to a path on one of my other sites.  For example, I want all traffice for www.mydomain1.com to be redirected to www.mydomain2.com/path/pageRepresentingMydomain1.htm.   I have access to the name servers, registrar, etc. for both domains, but I'm not certain what is the best way to achieve this.

The server that will accept traffic for both domains is running IIS on Windows Server 2008.
Comment
Watch Question

Commented:

You create a index.html file and in metadata put:

<meta http-equiv="refresh" content="2;url=www.mydomain2.com/path/pageRepresentingMydomain1.htm/">

nrisimha

Commented:
And here is a all code that you need.
Redirection will be for 3 second but you can change it in metatag:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <title>New Text Document</title>
  
[b]  <meta http-equiv="refresh" content="[b]3[/b];url=http://www.mydomain2.com/path/pageRepresentingMydomain1.htm/"> [/b]


</head>
<body>
<center>
<br>
Redirection for 3 seconds
</center>
</body>
</html>

Open in new window


Commented:

Sorry, the right code that you will save as index.html and put on your http://www.mydomain1.com/ site is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <title>Redirect</title>
  
  <meta http-equiv="refresh" content="3;url=http://www.mydomain2.com/path/pageRepresentingMydomain1.htm/">


</head>
<body>
<center>
<br>
Redirection for 3 seconds
</center>
</body>
</html>

Open in new window


Commented:


So, if you need fast redirection you can put in your index.html page a meta tag where the page will be shown only 1 second.
But, the web browsers need some time for loading a web page index.html so this redirection will be very fast.

Insted a number 3 ( 3 seconds ) you can put number 1 ( 1 second ) in meta tag in index.html so it will look like:

<meta http-equiv="refresh" content="1;url=http://www.mydomain2.com/path/pageRepresentingMydomain1.htm/">

For 10 seconds of redirection put:

<meta http-equiv="refresh" content="10;url=http://www.mydomain2.com/path/pageRepresentingMydomain1.htm/">

And also you can write some sentences in the body tag if you want. But, for 1 second the visitors will can't to read this !

regards

Nrisimha


just put domain2 URL into domain 1 URL redirection Option.
Blair BenjaminSr. Systems Administrator

Author

Commented:
Thanks for all of the comments.  I do actually know how to do a redirect as described here.  The problem is that in my fictional example here, www.domain2.com needs to function as normal site - I can't redirect the home page elsewhere.  So I need only incoming traffic that was intended for www.domain1.com to be redirected to the path that lives elsewhere on www.domain2.com.
Sr. Systems Administrator
Commented:
The web host (Blue Host) for one of my sites has a control panel option for adding secondary domains to a site which can point specifically to a subdirectory within another site.  So, I went that route and it seems to work.  I don't know the technical specifics of how it is accomplished under the hood, but the net effect is that I was able to achieve what I needed.
Blair BenjaminSr. Systems Administrator

Author

Commented:
I didn't actually get a solution, but rather found a work-around on my own.