This one can become a huge battle - the behaviour is rewarding for the dog and most of us just don't have the patience or time to watch every second the dog is outside.
Try giving in.....let them dig!! Even hide toys so that they can find them and have a really good time!!
BUT - dig out a small bed or corner and fill with sand mixed with compost and shredded bark. Pick a week when you can be around for this area to become available to the dog when you CAN be around and concentrate on the problem. Introduce the area as a really fun place to be - get digging yourself, show the dog the toys you are hiding, just under the surface at first. Allow only short visits that are VERY fun for the first few days. For some, this is enough to focus attention on the digging area. Others will still need redirecting for a little while.

A great game to teach the dog is to "find". It is just like a fetch game but the dog doesn't see you hide the toy in the digging area. (At first you allow the dog to watch you stick it under the sand after you have played normal fetch and the dog is into the game - gradually build it up, make it fun and exciting not an excersise and the dog should soon understand that this bit is O.K. to dig in and the rest not.)

In my defence, before you all rush out to dig pits and sacrifice your favorite shrub in the process, not ALL dogs go for this. You are going to have to judge this one on your own - I have done it successfully with 7 out of 11 diggers that I tried it with. Not the kind of statistic I'm usually happy with I have to confess but when it works - it's brilliant!