Sidi Yusuf ibn 'Ali as-Sanhaji (Arabic: سيدي يوسف بن علي الصنهاجي) is a wali (Muslim mystic or saint) who was born in Marrakesh, Morocco and died there in 1196 CE. He is considered one of the Seven Saints of Marrakesh, and one of the administrative divisions of Marrakesh is named after him.
Yusuf ibn 'Ali was born in Marrakesh to a family of Sanhaja Amazigh origin and lived in the city his whole life. He studied under Sheikh Abu 'Usfur. He was afflicted at a young age with leprosy, for which he was allegedly banished from his family and from living in the city. He took up residence in a nearby cave or in a hollow that he dug himself, in the lepers' quarter outside the southern city gate of Bab Aghmat. Despite his ill health, he lived longer than anyone expected and many began to believe he possessed powers to resist hunger and disease. Locals came to visit him in his cave seeking guidance, and he came to be known also as Mul al-Ghar (meaning roughly "Man of the Cave"). He died in 1196 CE and was buried in or near the cave where he lived.
Yusuf ibn 'Ali's reputation grew over time and he became one of the most celebrated of the many awliya ("saints") of his native city. In the 16th century the Saadian sultan Moulay Abdallah al-Ghalib built a mausoleum and zawiya over the cave where he was buried. The sultan's reasons for this are unclear but may have been a conciliatory gesture over his displacement of the leprous population from Bab Aghmat to Bab Doukkala.: 378–379 Later on, he was counted among the "Seven Saints" of Marrakesh and his tomb became the first stop in a yearly pilgrimage, or ziyara (Arabic: زيارة), instituted by the Alaouite sultan Moulay Isma'il in the late 17th and early 18th century. Today, the neighbourhood and suburb around the mausoleum is part of the local prefecture of Sidi Youssef Ben Ali, named after the saint.