Bab Oudaya

Bab Oudaya (also spelled Bab Oudaia or Bab Udaya; باب الوداية),   also known as Bab Lakbir or Bab al-Kabir (باب الكبير), is the monumental gate of the Kasbah of the Udayas in Rabat, Morocco. The gate, built in the late 12th century, is located at the northwest corner of the Kasbah, uphill from the medina of Rabat. It is often cited as one of the most beautiful gates of Almohad and Moroccan architecture.

Historical background
In 1150 or 1151, the Almohad ruler Abd al-Mu'min built a new kasbah (citadel) over the site of a former Almoravid ribat on the southwest shore of the Bou Regreg River, within which he included a palace and a mosque.

His successor, Abu Yusuf Ya'qub al-Mansur (ruled 1184–1199), embarked on a huge project to construct a new fortified imperial capital, called al-Mahdiyya or Ribat al-Fath, on the site of what is now the old city of Rabat, with new walls extending over a vast area beyond the old kasbah. This project also included the construction of an enormous mosque (the remains of which include the Hassan Tower) and of new grand gateways including Bab er-Rouah. At the kasbah, al-Mansur added a monumental new gate, Bab al-Kbir, which was inserted into the previous walls of the kasbah built by Abd al-Mu'min around 1150. The gate was built some time between 1195 and 1199. After Abu Yusuf Ya'qub's death in 1199, the mosque and the capital remained unfinished and his successors lacked the resources or the will to finish it. The kasbah itself became essentially abandoned.

By the 18th century, under the 'Alawi dynasty, the gate had been walled-in and converted into a prison. According to Joseph de La Nézière, another structure once existed on top of the gatehouse, accessed via the inner staircase terrace, but was likely demolished in the 18th century. The name "Oudaya", which is now associated with the Kasbah, dates from the 19th century, after the Udayas tribe, a guich tribe ("army" tribe serving in the sultan's military) that was expelled from Fez by the 'Alawi sultan Abd ar-Rahman in the late 18th century and whose remnants then settled in the kasbah.

A restoration of the Kasbah of the Udayas was initiated in 1914 under the French Protectorate. The work was led by Maurice Tranchant with the assistance of local master craftsmen, including Hadj Driss Tourouguy. As part of this project, they also restored the gate. The vaulted ceilings of the gatehouse were entirely reconstructed under the supervision of Jean-Baptiste David and this work was finished in September 1918.

Architecture
The gate has both an outer façade (facing southeast towards the city) and an inner façade (facing northeast onto the Street of the Mosque), both richly decorated. The massive gate was largely ceremonial and had little defensive value, given its position already inside the city walls; unlike Bab er-Rouah, the ornate western gate in Rabat's city walls, built around the same time, it was not flanked by true defensive towers.

The carved decoration around the horseshoe arch entrance features a curved band of interlacing geometric forms (specifically, a pattern known as darj wa ktaf, commonly seen in Moroccan architecture), set inside a rectangular frame outlined by a Qur'anic inscription frieze in Kufic Arabic script. The inscription includes the Surat As-Saff (61:9-13), which contains references to jihad, as befitting the kasbah's role as a symbol of Almohad military might. In the corners between this curved band and the inscription are carved arabesque or floral patterns with a palmette or scallop shell at their middle, and above these is another carved frieze of palmettes. Further above all this is another band of geometric carving, at either side of which are two ornate corbels, set above decorative engaged columns, which probably once supported a shallow roof or canopy covered in green tiles. At both corners of the horseshoe arch (at the bottom of the curved band of geometric carvings) are serpentine "S"-like forms, probably representing eels, which are a very rare motif in Almohad or Moroccan architecture. The external façade of the inner gate, facing towards the kasbah, has carved decoration very similar to that of the outer gate, but with minor differences in the choice of geometric forms.

Inside, the gate has three chambers which form a bent passage: two square chambers covered by domes and a third chamber covered by a barrel vault. Entering through the main outer gate, each chamber is reached by a short flight of stairs. The second chamber opens to the kasbah's interior via the monumental inner gate. The third chamber (rarely open to visitors) can be accessed by a smaller doorway from the second chamber and also has another doorway exiting to the kasbah, though much smaller than the main inner gateway. The archways inside the two first chambers feature decorative geometric carvings similar to the outline of the outer gates, but without the rest of the extensive decoration around them. At the far north end of the interior, a staircase climbs up to the top of the gatehouse.