tags:

views:

204

answers:

4

I am currently having two domains www.xyz.com and www.pqr.com. If anybody enters xyz.com I need to bringout the website pqr.com

Both are on the same server.

Kindly suggest how to go about this.

Thanks

+1  A: 

If you want to say that "you should always go to foo instead of bar," you want a 301 redirect (which you do with your front-end server). See http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=93633

A 302 (temporary) redirect should be used in cases where you can't serve a page, but expect it to come back later. Unfortunately, it's the redirect that you get from JSP forward.

A client-side (meta refresh or javascript) redirect should be avoided whenever possible.

Apache docs for configuring a permanent (or temporary) redirect.

altCognito
Ugh, need to be more explicit about using iis
altCognito
Go ahead and edit your question to update the specificity.
maxwellb
+3  A: 
  • In internet services manager, right click on the file or folder you wish to redirect then select "Properties"
  • Select the radio titled "a redirection to a URL".
  • Enter the redirection page
  • Check "The exact url entered above" and the "A permanent redirection for this resource"
  • Click on 'Apply'
Otávio Décio
Also, if you are using IIS, and not Apache, you could serve names for multiple hosts from one web site.
maxwellb
on first step, add at the end of line, "then select "Properties..""
curtisk
Thank you, curtisk
Otávio Décio
A: 

If you want pqr.com to appear in the user's browser's address bar, you'll have to send a 301/302 redirect response, either through a script or through your web server's configuration - how to do this depends on what software you are using.

knabar
+1  A: 

From http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/6b855a7a-0884-4508-ba95-079f38c77017.mspx?mfr=true

To redirect requests to another Web site or directory

  1. In IIS Manager, expand the local computer, right-click the Web site or directory you want to redirect, and click Properties.
  2. Click the Home Directory, Virtual Directory, or Directory tab.
  3. Under The content for this source should come from, click A redirection to a URL.
  4. In the Redirect to box, type the URL of the destination directory or Web site.
ylebre