Sounds like normal plug and play feature. The computer recognize if the headphone socket is connected or not and put output depending on that?
Or is is so that the sound does not come back to the headphones? Then the normal solution would be looking for sound settings, but I suppose you already did that.
A little more information. What operation system, what sound system...