By having a minimum amount of foresight and putting into the initial contract an agreement which lets the parties maintain the online availability in a mutualy agreeable way.
Why do you think it's a problem of foresight and not simple motivation? Perhaps none of the parties cares about the availability of a book that doesn't make enough money to stay in print. Perhaps having the book become unavailable for some time is perceived as a benefit to the rights holder, allowing them to do a re-launch.
Meanwhile, the author doesn't own the rights to the cover art/design so they can't just put it up either.
I'm not sure how else you'd want to handle it.