I have MVC3 & SqlServer 2008 based application recently deployed. The application works fine & gets data from DB when I type http://www.mywebsite.com but I omit www and just type mywebsite.com in address bar, the application fails to get data from DB.
Thanks,
Bilal
Likely, you are using restful URL’s to access the data (think Ajax, JSON). If you access the DB over hardcoded urls that include www, then you’ll get problems with browsers that prevent cross-domain requests from javascript for security reasons.
Edit come to think of it, the inverse might be the trouble: if you aren’t use a hardcoded base path but the AJAX service doesn’t respond on the
www.-less virtual host (see host headers), that would lead to the request not getting to the webservice/database. A little bit of errorhandling would prevent such things from going unnoticed, though.Solutions: