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.
benjaminfamAsked:
Who is Participating?
 
benjaminfamConnect With a Mentor Author 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.
0
 
NrisimhaCommented:

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

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

nrisimha
0
 
NrisimhaCommented:
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


0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
NrisimhaCommented:

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


0
 
NrisimhaCommented:


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


0
 
Vivek ReddyCommented:
just put domain2 URL into domain 1 URL redirection Option.
0
 
benjaminfamAuthor 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.
0
 
benjaminfamAuthor Commented:
I didn't actually get a solution, but rather found a work-around on my own.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.