 Between 1901 and 1908 the Ottomans built the Hejaz railway in order to link Damascus to Madinah.The railway had main stations in both Mada'in Salih (Hegra) and AlUla, where a line was built through the western part of Al-Khuraybah, some to the north of the old medieval town, which is believed to be the site of the old Dedanite and Lihyanite town that is still standing there despite being in bad shape.In the 20th century the new town centre was established beside the old town and eventually the people left the old buildings.