It sort of worked like that, though that wasn't the intention? By which I mean, as I understand it, all the pyramids were robbed a very long time ago, but Tutankhamun's tomb survived undisturbed until the 20th century because it wasn't in a pyramid.