Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6720241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:11:21+00:00 2026-05-26T09:11:21+00:00

I have MVC3 & SqlServer 2008 based application recently deployed. The application works fine

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:11:22+00:00Added an answer on May 26, 2026 at 9:11 am

    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:

    • Don’t hardcode the base url (get it from HttpContext/ServerContext)
    • or redirect the ‘domain.tld’ to ‘www.domain.tld’ in either
      • DNS (CNAME record)
      • or the webserver config (http://learn.iis.net/page.aspx/496/iis-url-rewriting-and-aspnet-routing/ ?)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have recently upgraded from mvc2 to mvc3 and one of our Custom Authorization
I have application built on asp.net MVC3. Application runs fine but I see one
I have upgraded to MVC3 and Razor, everything works fine. However, in my return
Using: ASP.NET MVC3 Ninject 2 Fluent nHibernate I have 2 databases (DB1 & DB2).
I'm deploying an MVC3 application to a new server. The application runs fine on
I have following Linq query/function in my MVC3 application. public AuditTrail GetNamesAddressesEmployers(long registryId ,
I have an MVC3 application which has a reference to DLL. This DLL is
I have an MVC3 application, I know that for relative paths, I can use
I have an MVC3 solution where I have 2 repositories & 2 service layers.
I have a simple MVC3 application that I want to retrieve some configuration details

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.