Suggestion #1: The Cliche
Ensure that your campaign includes frequent stops (that is, between dungeons - so to speak) at a common gathering place for adventurers. This makes it easy to accommodate players moving in and out of the game. This is aided by ensuring players understand that they are expected to stick with the game through the end of any adventure they start. This doesn't ensure cooperation, of course, but setting reasonable expectations and making them clear can go a long way.
Suggestion #2: The Annoyance
When a player leaves the game, turn them into either a temporary or permanent NPC. This could actually be a good way to acquire a recurring cast of characters with whom the PCs have a preexisting relationship. Aside from the headache for the GM of managing such a cast, the annoying part comes in when finding unique and believable ways for each new character to join the game. Often, it may be best to simply allow the new player to observe play and look for an opening where they feel their character could have appropriate justification for presenting themselves.
Suggestion #3: The Non-Answer
You may be unnecessarily assuming the worst. If you make it clear that you're looking for players on a semi-permanent basis there's no reason to assume your online attrition will be any worse than your real-life one. Maybe set up a series of mini-adventures to give prospective players a chance to see if they like the speed and tone of the game before settling in for the long haul but you may be making a mountain out of a speed bump.