Click here to Skip to main content
15,905,563 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have my project whose name is e.g. "xyz". It is a live project on the website. The problem is that when I write "xyz" on any browser url place and I will click enter not ctlr+enter then it has to redirect to "http://www.xyz.com" in a programatic way. I am using .net 2.0 and iis server for my project. Please tell me the solution for that.


2nd problem is that in the same url when I write "xyz.com" then enter it is going to the page but it is displaying as "http://xyz.com" instead of http://www.xyz.com"

Please tell me if u have any answer to this problem in .net 2.0 and iis server.
Posted
Updated 14-Nov-10 20:53pm
v2

1 solution

Your first problem cannot easily be fixed because it is up to the browser. In the early days the browser gave an error but most browsers today will look it up using your default search engine. You have absolutely no control how a browser handles this.

For your second problem the solution is easy by simply adding a hostheader (in iis -> Advanced Web Site Identification). For more info have a look here:
http://serverfault.com/questions/88030/redirect-to-domain-without-www[^]

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900