Most of the time in all the Spanish speaking countries I've been in I've heard de nada as the reply to gracias or the equivalent of English you're welcome etc.
But after a while I became conscious that sometimes some people were instead saying por nada.
Are they actually used in different grammatical situations? Does the de vs por depend on something in the topic of what the thanking was about?
Or is it purely up to how the speaker feels, or is one more prevalent in certain places? Or is one less formal or not condoned as official by the RAE?