From Sahih Bukhari (Hadith 4512):
Narrated Al-Bara:In the Pre-Islamic Period when the people assumed Ihram, they would enter their houses from the back. So Allah revealed:-- "And it is not righteousness that you enter houses from the back, but the righteous man is he who fears Allah, obeys His Orders and keeps away from what He has forbidden. So enter houses through their doors
Reference: Bukhari 4512