Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 6th, 2008, 12:58 PM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default typing abc.com opens http://abc.com and not http:/

Hi,
I have a question on the DNS/redirection.
I have a Shopping cart application developed in asp.net 2.0 and for example when I type abc.com, the browser opens http://abc.com. I Instead of http://abc.com, I want it to open as http://www.abc.com

Eg see the difference by typing google.com in IE

google.com -> http://www.google.com

Is there any DNS entry that has to be resolved? or something else that
needs to be done.Do i have to do any settings on the server or i have to add anything code in web.config.

I don't think I want response.redirect property in my pages.

Thanks in advance.

  #2 (permalink)  
Old February 6th, 2008, 01:43 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

When you request google.com, google responds with this:

HTTP/1.0 301 Moved Permanently
Location: http://www.google.com/

They are simply detecting the URL http://google.com and forcibly redirecting you. This is not a function of DNS.

You could configure IIS to do this. Create a web site with the host header of "abc.com". This web site would simply be a redirector to www.abc.com.

Alternatively you could do the same URL check somewhere in code and then just redirect the client.

-Peter


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update ABC.asp with a new date shown automatically cJeffreywang ASP.NET 2.0 Professional 1 July 18th, 2007 11:29 AM
http://mysite.com or http://www.mysite.com anshul HTML Code Clinic 1 December 27th, 2004 03:50 PM
http://domain or http://www.domain anshul HTML Code Clinic 9 August 11th, 2004 01:09 AM
HTTP Status 405 - HTTP method GET .... nsakic Servlets 1 January 25th, 2004 04:50 PM
Using parameters without match="/ABC/.. sk36 XSLT 6 December 19th, 2003 02:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.