The dwellings of Thamud: Thamud were the people of the Prophet Ṣāliḥ (upon him be peace). Allah sent Ṣāliḥ to them to remind them of their Lord, but they rejected him. He therefore declared, “Enjoy yourselves in your homes for three days,” after which the mighty Blast and a violent quake seized them, and by morning they lay lifeless in their very dwellings. Allah, exalted be He, had granted them the power to carve houses into the mountains and to raise palaces upon the plains, and they became a formidable nation. Yet Allah struck them with a quake and a cry, and every last one of them perished.
While traveling to Tabuk the Prophet (peace and blessings be upon him) passed by their ruins and said, “Do not enter upon these people unless you are weeping. If you are not weeping, do not go in, lest what struck them strike you.” Hence we say: it is not permissible for anyone to visit the dwellings of Thamud merely for sightseeing, for that would be an act of disobedience to the Messenger (peace and blessings be upon him)—except for someone who goes to take admonition, and who is weeping as he passes through those places. If he is not weeping, he must not enter them, for he may be overtaken by what overtook them.
When the Prophet (peace and blessings be upon him) entered their valley, he covered—or lowered—his head and hastened his pace until he had left the valley behind. From this we recognize the error of those heedless people who travel to the ruins of Thamud for leisure and recreation, lingering there for days to gaze upon their ancient remains; such behavior contradicts the guidance and Sunnah of the Messenger (peace and blessings be upon him). Indeed, when he passed those ruins he moved quickly, covered his head, and warned against living in the dwellings of those who had wronged themselves.