The spate of terrorist attacks in France show its hardline approach to the problem has failed

As the horrific news keeps coming in from the terrorist attack in Nice in southern France many will ask how Western societies can protect themselves from Islamic State-inspired terrorism. But it is worth remembering that just a week ago 300 people were blown up in Baghdad. The West isn't the only target of terrorists. In fact the overwhelming victims of IS (Isis/Daesh) and other jihadi terrorism are still Muslims.

This should tell us something important when we consider a response to terrorist attacks, whether they take place in Nice, Paris, Istanbul or Baghdad – Europe is not fighting a war against Muslims but people who want open, tolerant societies are fighting one against religious fanatics.

If anything, the spate of terrorist attacks in France show its hardline approach to this problem has failed. It rejects multiculturalism and diversity in favour of assimilation and an uncompromising stance on religion in public life. It has also been in a "state of emergency" since November last year, giving police extraordinary powers to search houses, make arrests and spy on suspects.

But the French-Tunisian man behind the Nice attack appears to be a lone-wolf madman who was reportedly not on any terror watch-list. He was a divorced father of three who had become depressed after his marriage fell apart. He was "more into women than religion", a neighbour told French TV. This follows a similar pattern to the Orlando gay-club gunman, who reportedly had issues with his own marriage and sexuality.

And yet, after every such attack, we hear so-called terrorism "experts" calling for an even more hardline approach to IS. The only way France could compound its problem now is by adopting Donald Trump's idea to ban Muslims from entering the country. That wouldn't work obviously, since many of the terrorists have been French citizens. Lock up all Muslims, perhaps? Then France may as well then call itself a fascist state.

A girl holds up a placard during a prayer meeting to show solidarity with the victims of the Bastille Day truck attack in Nice, at a school in Ahmedabad, IndiaAmit Dave/ Reuters

Donald Trump this morning said "we are at war". This sort of rhetoric is not only doomed to fail, it plays right into the hands of the jihadis. France can't take this approach any further. It has to change course. It doesn't help if every lone-wolf attack by a deranged man is turned into an international jihadist plot that requires a state of emergency.

I'm not blaming the French people for the atrocities they have suffered nor saying the French government has brought this upon themselves. As I've written before, IS-inspired terrorism is not a response to Western foreign policy – it is a violent response to our way of life and our beliefs in an open liberal society. This is why the jihadists attack anyone, including Muslims, who even slightly deviate from their extremist and fanatical vision of the world. In that fight, Muslims are our allies against jihadis, not on the other side.

Rather than turning them into suspects, the French government has to work harder with its Muslim citizens to listen to them, to help those in danger of being radicalised, and become their ally against the extremists. There are interesting and successful attempts being tried in Scandinavia, and France would do well to try them too.

The risk now is that these terror attacks will likely drive support for the National Front and give Europe its first major far-right government since the Second World War. That in turn will feed into the jihadist narrative that the west is at war with Islam, and feed the "clash of civilisation" narrative on both sides.

We cannot react to IS in a way that would strengthen its appeal and play into its hands. Today, on the day of the funeral of the British MP Jo Cox, murdered just weeks ago, we must remember her words: "We have far more in common than that which divides us."

Sunny Hundal is a journalist, commentator, author of India Dishonoured and lecturer on digital journalism at Kingston University, London. He is on Twitter @sunny_hundal