This is the shape of the medina of Marrakech as it has been since 1760. There are 10 gates - or 'Bab's.


This Medina or 'old town' is an old Islamic capital originating from the 11th century, enclosed by 16km of ramparts and gates.

The city owes its original splendour to the Almoravide and Almohade dynasties (11th – 13th centuries), who made Marrakech into their capital.

Jemnaa El Fnaa square is right in the middle, at some 500 meters or a 5 minute walk from the Koutoubia mosque - with its 77m high minaret a key monument of Islamic architecture.

Other architectural and artistic masterpieces from different periods in history in the medina are: - the ramparts and gates (in pinkish clay, like most of the original structures), the Saadian tombs and Ben Youssef Madrassa.

You will find Sidi bel Abbes in the north, under the gate named Bab Taghzout.


Leon Africanus wrote that Marrakech was constructed in conformity with the prescripts of astrological experts.

Earlier documents confirm this, agreeing that forty intellectuals, theologians, astronomers, mathematicians and astrologists, gathered in 1120 to decide on the position of the Ben Youssef Mosque and once again in 1126 to decide the path of the ramparts.

Using the astrological principals of Ibn Abi’r Rigal, they began construction during a period when the crescent moon coincided with the conjunction of the favourable planets of Jupiter and Venus, when the ‘pivots’ of the astral chart were in the ascendent, and taking into account the latitude of Marrakech, the path of the moon relative to the sun, and any ill-omened stars.

The magnificant gateways of the city undoubtedly served as ‘grid-points’ for the path of the ramparts. Lines can drawn through the Ben Yousef Mosque, the original centre of the medina, to connect the various gates in the city wall, with interesting results: to cite just one example, the distance between Bab Khemis and Ben Yousef Mosque is 860 metres, exactly twice the distance, 1720 metres, between the same mosque and Bab er Robb.

Indeed, at the core of every quarter in the city is the mosque. The qibla, the direction of prayer to Mecca, is fundamental in its design. However, each epoch produced its own theories as to the calculation of the qibla, but which had its own effect on the development of the medina.

> How planning for privacy shaped the riad and Marrakech Medina