There are generally two things that lead to this error.
The Server requires HTTPS for that url. To fix, just change the URL to https://server/page.htm
You have entered the URL for a directory, and the server has no default document specification for that directory. To fix, add the page you wish to visit to the URL following a /
. In Example: http://server/page.htm
Since you appear to be talking about publishing the application, I'm leaning toward option 1.
Additionally, you say that after publishing several times, and failing, it suddenly succeeds. Assuming you are not changing settings between retries, If that is the case, then the server you are publishing to is not stable, and you will need to contact your service provider.
What do you mean by After installing a few times the site was opened – pun – 2015-11-23T12:20:46.737