Why won't this file download?

Web Servers: Why there is difference in behavior of file download dialogue between IP address and Domain name in URL?

  • In intrAnet, When I give something like 'xxx/download/check.xls' and if this file is not present in this location, the webserver provides the right error message. But instead if I try the IP address instead of the domain name (eg: 10.10.10.10/check.xls) then the browser throws me a file download dialogue. Please note that such a file does not exist. When I click on 'save' or 'open' then it says that such a file is not there or the file is corrupt... any reason why this happens?

  • Answer:

    What you see has nothing to do with download a such. Say you have a server on the internet with one IP Adress (like 50.17.196.92), this server may have several domain names that all resolve to this IP Adress (like http://mydomain.com, http://otherdomain.net, http://somethingelse.org). So in the example with three domains and one IP Adress, we end up with four possible URLs: http://50.17.196.92 http://mydomain.com http://otherdomain.net http://somethingelse.org Requesting any of these URLs from your browser will lead to the same server. But the server will react differently to every URL. If you are using Apache as your web server software, you can configure this behaviour using the <VirtualHost> Directive. You can set up a virtual host for every domain, and you can have a default configuration for all requests that are 'left over'. See http://httpd.apache.org/docs/2.1/en/vhosts/name-based.html

Brigitte Jellinek at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.