In the endless debates about hijab there's a common misapprehension that it applies only to women.

This is not altogether surprising because Islamic scholars (all of them male) have spent far more time over the years prescribing detailed and often very restrictive dress codes for women than they have for men.

With so much attention devoted to the regulation of female clothing, feminists have naturally come to regard hijab as a case of discrimination against women or a symbol of their oppression. But male hijab also exists and seems to be increasing in importance.

The general idea behind hijab is that Muslims should dress "modestly" - by covering up their "private" parts and avoiding clothes that are flashy or extravagant - and this includes men as well as women.

Though there are differences of opinion among Muslims as to what, exactly, constitutes male hijab, Wikipedia gives a broad-brush summary:

The opinion that Muslim men must cover themselves between the navel and the knees is predominant, and most Muslims believe that a man who fails to observe this requirement during salat must perform the prayer again, properly covered, in order for it to be valid. Three of the four madhabs, or schools of law, require that the knees be covered; the Maliki school recommends but does not require knee covering.

A significant minority also consider that men should wear long sleeves in public, covering the arms up to the wrists. Such a law was in place in Iran for some time after the 1979 revolution.

According to some hadith, Muslim men are asked not to wear gold jewellery or silk clothing. Some scholars says that these prohibitions should be generalised to prohibit the lavish display of wealth on one's person.

Look around the internet, though, and you'll find much more detailed "rules" prescribed by the more rigid-minded Muslim websites. Muttaqun Online, which actually uses the phrase "unlawful clothing" in its explication, says that men's clothes should cover the whole body but not reach below the ankles, and must not be tight-fitting. White and green are good colours to wear but red is bad, unless mixed with another colour, and you musn't tuck your shirt inside your trousers.

Beards are obligatory and must not be trimmed (though the moustache part should be cut). Invoking science in support of this, Muttaqun says: "Medical reports reveal that the beard protects the tonsils from sunstroke".

There are warnings on other websites against men wearing gold jewellery, silk or "feminine" attire. Feminine dress includes male neck-chains, bracelets and earrings according to IslamOnline.

Though many of these "rules" have a dubious basis in scripture, it is one thing for individuals to follow them voluntarily in the belief that heaven's bouncers operate a strict door policy ("no hoodies, trainers, gold rings or unshaved faces") but trying to impose them on their fellow-Muslims is something else entirely.

We have seen this happen in Afghanistan under the Taliban, in post-revolutionary Iran and in Saudi Arabia, with the setting up of religious police forces to monitor standards of dress and other aspects of personal behaviour. Now, the same thing is happening at an unofficial level in Iraq, where militias have even murdered barbers for giving customers "un-Islamic" haircuts.

One Iraqi who eventually got asylum in Britain described how he was accosted near his home in Baghdad by a group of men:

I was told to grow a moustache and beard. I was told not to wear jeans or tight clothes but I must wear traditional clothes ... and that I must not grow my hair long and that I should not wear bright colours or shirts with English writings or western style.

He was then beaten up while onlookers cheered.

Though hijab itself is nothing new, the concerted efforts to universalise the rules and impose strict "Islamic" dress codes do seem to be a fairly recent development - probably over the last few decades.

Historically, Muslims in various parts of the world have dressed in a variety of ways - often following local customs which pre-date Islam - and nobody bothered very much about the differences. Look at these Muslim men in stripey skirts with flowers in their hair. Not what you would think of as "traditional" Saudi attire - but traditional it is, at least in the remote south-west of the kingdom.

There are several possible reasons for the changing attitudes today.

In the old days, communities were fairly isolated. This allowed each to have its own distinct customs and traditions. Within each community, though, people would tend to dress similarly, for reasons of practicality rather than religious dogma; they would wear whatever was available locally, and choice was limited. There might be the odd eccentric who dressed differently, but they could be tolerated because no one saw them as a threat to the "Islamic" way of life.

Since then, modern communications - television, foreign travel and the like - have brought increased contact, not only between different Islamic traditions, but between different cultures. Young people pick up fashion trends from elsewhere and experiment with them, while religious folk - usually the literal-minded sort who believe anyone who disagrees with them will end up in hell - are appalled at what they see and feel threatened by the disregard for their authority.

Parallel with this is an international situation where many Muslims - rightly or wrongly - feel they are under siege from the west and respond to it, as a form of self-defence, through a re-assertion of supposedly traditional "Islamic values". In reality, some of these values may not be as traditional as people imagine but they tend to be highly visible, and strict enforcement of male and female hijab is one of them.

In communities that feel themselves under threat, this might be called "solidarity hijab" - the sartorial equivalent of patriotic flag-waving - where anyone who doesn't conform is regarded as betraying the cause.

A variation on this, and usually more voluntary in nature, is hijab as a way of asserting identity. It can be found in areas where Muslims form a minority, and so the niqab - a highly practical form of dress if you're caught in a desert sandstorm - turns into a religious/political statement when worn on the streets of Britain. It happens in Muslim countries too, though. Saudi salafis, for example, use "indentity hijab" to distinguish themselves from other Muslims and in countries where political dissent is restricted styles of dress become an important way of expressing opposition to the government.

Despite the invocations of Islamic tradition, all this seems far removed from the original concept of hijab: that Muslims should simply assume a modest appearance. In extreme cases, it also reflects an extraordinarily superficial approach to religion where there's more concern over a man who is "improperly" dressed than a one who takes bribes at work and beats his wife at home.