
Morocco's Medinas Were Built to Lose You — and That Was the Whole Point
The medina of Fez is not confusing by accident. Somewhere around 9,000 streets — by most counts — are packed into roughly two square kilometres of medieval stone, ending in dead-end lanes barely wide enough for a person carrying a basket on each arm. Strangers walk in circles. Locals walk home. This is not a failure of urban planning. It is the plan.
What Is Actually Happening When You Get Lost?
Stand at the entrance of Rue Talaa Kebira — the main artery of Fes el-Bali, the old city — and the medina makes a kind of sense. It is wide enough for two loaded mules to pass. The souks line both sides. People move with purpose.
Turn off it, and the logic changes fast.
The walls close in. Windows disappear from ground level. There are no street numbers, no signage. The lane narrows to shoulder-width — what is known as a derb, a semi-private residential alley that branches off the public artery — and fifty metres later you are standing in front of a heavy iron door that leads to someone's home. Dead end. Turn around.
This is not disorientation as side effect. According to conservation architect Amine Kasmi, who has documented Maghrebi urban form extensively, the medina operates as a deliberate three-tier hierarchy: the tariq, the main public street connecting the mosque, souk, and city gates; then semi-public lanes; then the derb, which under Islamic legal tradition was considered quasi-private property.1 Residents had the right to lock the entrance gates of their derb after evening prayer. Not their house — their entire lane.
A stranger entering a derb without invitation was not just lost. They were trespassing.
The mechanism is elegant. No walls, no guards, no checkpoints. Just a street layout that filters — by social logic as much as physical form — anyone who does not already know where they are going.
Why Did Religious Law Shape the Street Plan?

The military explanation for labyrinthine medinas is real but incomplete. The deeper driver was hurma — the Islamic concept of inviolability, particularly of the home and family. The word shares its root with haram (forbidden, sacred). In Islamic jurisprudence, the domestic threshold was not a practical boundary but a sacred one, and architecture was expected to enforce it.
This produced a specific urban grammar. Windows facing neighbours' windows were forbidden or strictly regulated. Dead-end lanes existed so that strangers could not pass through a residential zone, even accidentally. The riad — the traditional Moroccan house built around an interior courtyard garden — presented a completely blank face to the street. No windows at ground level. No indication of what lay within. The beauty of the house was inside, entirely invisible from outside, because the outside was, by religious reasoning, not where beauty was meant to be seen.2
Kasmi's lecture at MIT's Aga Khan Documentation Center describes the Maghrebi medina's enclosure as "pushed to the extreme" compared to other medieval Islamic cities — not for one reason but three simultaneously: military defence, climate management (the narrow lanes function as shade channels, dropping temperatures significantly), and the cultural-religious imperative to protect domestic privacy.1 One architectural form solving three problems through the same physical logic.
The result is a city that is not chaotic. It is highly ordered — but the order is legible only to insiders.
How Did Two Refugee Cities Become One Labyrinth?
What makes Fez specifically extraordinary is that Fes el-Bali was not always one city. According to UNESCO's World Heritage documentation, it was originally two separate walled settlements on opposite banks of the Fez River: one founded in 789 AD by Andalusian refugees expelled from Cordoba, one founded in 809 AD by Kairouanese refugees from Tunisia.3 Two populations, two founding cultures, two distinct urban grammars — separated by a river.
They merged under the Almoravids in the 11th century. The river was covered. The two cities grew into each other.
The labyrinthine complexity of modern Fes el-Bali is not just the product of centuries of organic growth. It is partly the ghost of two medieval refugee cities that developed independently and then fused. Their boundary is now invisible, but still faintly legible in the shift of street patterns if you know where to look.
Inside this compound labyrinth, the medina is further sub-divided into self-contained neighbourhood quarters called hawmas — each with its own mosque, hammam, communal bread oven, and fountain. The logic was not just defensive but metabolic: residents could live almost entirely within their hawma, reducing the need to navigate the wider city. The labyrinth beyond was for commerce and strangers, not for daily life.2
When a sabat — a room built over a derb, creating a tunnel-like covered passage — drops the light and eliminates sightlines, a visitor cannot tell whether the next fork leads somewhere or dead-ends three metres ahead. The disorientation goes vertical, not just horizontal.
When Computer Scientists Tried to Model the Chaos
In 2007, researchers Rocha and Duarte applied parametric shape grammar analysis to the Zaouiat Lakhdar quarter of the Marrakech medina — effectively attempting to reverse-engineer the labyrinth's rules using computational methods. What they found challenged the premise of the question.
The apparent disorder encodes three distinct, computable rule-systems: an urban grammar governing how streets relate to each other, a negotiation grammar governing how buildings share walls and thresholds, and a housing grammar governing interior layout.4 The chaos has an algorithm. Nobody wrote it down. It emerged from thousands of individual decisions made within a shared cultural and legal framework — what Kasmi calls "voluntaristic design."
This is the crucial distinction. The medina was not designed by a single planner with a defensive brief. It was grown, decision by decision, by residents who shared the same understanding of where public space ended and private space began. The labyrinth is the accumulated spatial expression of hurma across five centuries of construction. The result looks like a maze designed by a general. It was built by families making decisions about their front doors.
What the French Preserved — And What They Destroyed
When General Lyautey arrived in 1912 as France's first Resident-General of Morocco, he made a decision that would have lasting consequences: he chose not to demolish or modernise the medinas. Instead, he built entirely new villes nouvelles (new towns) adjacent to them — modern streets, French colonial architecture, wide boulevards — leaving the medieval fabric largely untouched.5
The physical result was preservation. Moroccan scholar Assia Lamzah's analysis, as cited in a School for International Training fieldwork paper on urban space in Morocco 6, is less generous about what was actually saved: the French "preserved it physically, but the social meaning of its space and the symbolism behind its layout and morphology were altered because it was misunderstood and misrepresented" — reducing a living urban social system to an aesthetic artifact, a picturesque heritage object for European visitors.
The medina survived as structure. It did not survive the encounter with colonialism intact as system.
The UNESCO World Heritage listing that followed in 1981 continued this ambiguity. A 2024 peer-reviewed study by Boussaa and Madandola in Frontiers of Architectural Research found that the Moroccan government's MAD 670 million rehabilitation programme for the Fez medina — targeting restoration of 1,197 historic buildings — had relocated approximately 50,000 inhabitants outside the walls, with the primary beneficiaries being elites and foreign investors rather than the low-income residents the programme nominally served.7 As one interviewee in that study put it: "Since the 1970s, efforts to safeguard the Fez medina and local resources have been patchwork and cosmetic in nature, which did not translate to direct benefits for the poor residents."7
Does the Labyrinth Actually Slow Gentrification?
There is a theory, frequently repeated, that the medina's structural complexity is its own protection against modern development. Car access is impossible. Heavy construction machinery cannot reach most streets. The narrow derbs resist the kind of block-level redevelopment that has swept through other historic neighbourhoods globally.
The theory is partly true and mostly wrong.
The structural friction is real. But riad-by-riad conversion has proceeded precisely because the unit of transformation is small enough to fit within the existing street fabric. In Marrakech's medina, there were under 50 tourist guesthouses in 2000. By 2008 there were approximately 450, of which around 70% were reportedly foreign-owned — a pace of transformation that compressed into eight years what took other cities decades.8 Morocco recorded approximately 19.8 million tourists in 2025, a national record. Foreign real estate investment reportedly surged 55% between 2024 and 2025, according to market analysts, though these figures originate from commercial sources rather than official government data. Traditional riads now achieve occupancy rates near 85% and annual rental yields of 15–20%.9
A room in the Fez medina that rented for 100 dirhams — roughly $10 — per month before the riad boom represents real estate now worth $70,000 or more according to estimates. The architecture that filtered out medieval invaders is generating 15–20% annual yields for the investors who learned to navigate the derbs by hiring local intermediaries.
The labyrinth does not stop gentrification. It makes it look different. Boutique rather than bulldozer. The streets remain narrow. The investors change.
What the medina has never resolved is the question of who the labyrinth was built to protect. Not visitors. Not investors. The families who understood, without being told, that a derb with a locked gate at nightfall meant: beyond this point, you are not welcome here. The city was a system for maintaining that boundary — spatial, legal, religious — against anyone who did not already belong.
That system is still physically present. It now mostly keeps strangers in rather than keeping them out.
QWhy are medina streets so narrow in Morocco?
QIs it true that you can lock a street in a Moroccan medina?
QAre Moroccan medinas officially protected?
QDoes anyone actually know all the streets of the Fez medina?
Show all 8 wordsShow fewer
Correspondence.