At the end of the 13th century, the Via Maris was moved eastward inland to improve the line of defence since Palestine's coastal cities were the first to fall to competing powers seeking to expand their domain. The route followed the coast of the Sinai, passing through Al-Arish, Rafah, Khan Yunis, and Gaza. There, a branch then turned eastward to Jerusalem, onto Hebron while another passed through Beit Hanoun to Ramlah through Daris and continued north to Lydda, through Jaljulia and Tira to the center of Qaqun. From Qaqun, the route branched into two, one leading to Jenin and the other to Wadi Ara. Many of these places were villages that had khans built there in the 14th century. The khan in Qaqun was built on the orders of Mamluk governor Sanjar al-Jawli in 1315, and under Mamluk rule, khans like the one in Qaqun were used by couriers on horseback, forming part of the postal network on the Gaza-Damascus road. Al-Qalqasandi (d .1418) mentioned Qaqun as a pleasant, though not particularly prosperous town, with a mosque, a bath, a handsome fort, and wells.