A lot of people have already mentioned a play box for the dog. My dog is a DIGGER, she loves it! I have places she is "allowed" to dig. She has a play area at home. She can dig in sand boxes at parks. She can dig in the woods.
And I encourage her by saying "DIG".... "dig-dig-dig-dig-dig! Good girl!"
And I discourage her from digging in the "wrong" spots. I say "No" but do NOT use the "D" word. I never say "do not dig" because she only hears "dig" and goes at it.
She loves to dig and does it every chance she gets, but she does not dig our yard, and never digs park lawns.
I've even put her to work, when my husband had to dig (in our yard) for some landscaping. We have some tough, rocky soil in our yard. I showed her where to go and said "dig-dig-dig" and she did some work.