Rajanish Kakade/Associated Press

The arrest of two women in Mumbai for a Facebook post is the latest heavy-handed move by India’s government to curb what Indian citizens say on the Internet.

The two women were arrested Sunday under a section of the Indian Penal Code that outlaws spreading “statements creating or promoting enmity, hatred or ill- will between classes” after one complained about the citywide strike sparked by the death of the Shiv Sena leader Bal Thackeray and the second woman “liked” her statement.

But the incident was just the latest in a string of recent arrests, detentions and account suspensions in India over online comments. If you live in India and have an opinion someone might not like, but you don’t want to become a target of the law, there’s one easy rule you need to follow, experts say: stay off social media.

Right now, “there’s nothing one can do but to close up your social media accounts” and stop voicing your opinion on the Internet entirely, if you want to guarantee you won’t be arrested in India, said Sunil Abraham, executive director at the Center for Internet and Society in Bangalore. (To be sure, that’s not what most free speech advocates recommend that you do. India Ink will soon have more on a social media activist who is fighting India’s strict Internet controls.)

Mr. Abraham advises extreme caution because India’s free speech rules have been historically weak (read more about India’s long history of censorship here), a relatively new Internet law is extremely broadly defined and police and lawmakers themselves are sometimes confused about what the actual rules themselves say.

Late last month, Ravi Srinivasan, a Puducherry businessman and an India Against Corruption volunteer, was arrested for his Twitter post that alleged Karti Chidambaram, the son of Finance Minister P. Chidambaram, had amassed a large amount of wealth. Mr. Srinivasan was arrested Oct. 30 but was later released on bail.

Earlier in October, an associate professor of the National Institute for Fashion Technology in Chennai was arrested after what the Tamil Nadu singer Chinmayi said was a long period of harassment on the Internet, including negative Twitter messages. In August, the Indian government demanded Internet service providers suspend hundreds of Web pages to curb ethnic tension and asked Twitter to suspend accounts parodying government officials. Last year, the central government asked social media companies to prescreen content about India for objectionable remarks.

The key culprits here are revisions to India’s Information Technology Act made in 2008 and 2011, experts say, that leave nearly everything that is transmitted via the Internet open to interpretation by nearly everyone who reads it on the Internet. Things that are considered “annoying” and “offensive” can, under the law, land their sender in jail for up to three years.

While some of India’s nearly 50 million Facebook users and millions of Twitter users are up in arms about the recent arrests in Mumbai and are sharing the woman’s original post, under the theory that the police can’t arrest everyone, conservative advocates don’t recommend that sort of action on the Internet.

V. Vijaya Baskar, an advocate with Madras High Court practicing civil, criminal and family law for over 10 years, said that there are basic guidelines of free speech behavior that should be followed, even by Internet users. The most important, he said, is to avoid the use of obscene language and pictures, which are considered a direct threat. He also advised against getting into confrontations with people you don’t know or recognize on social media.

“If you have a true and verifiable source or documented evidence, then making a public statement is not defamation, but making passing comments of any person, particularly people in public life, will amount to defaming the person and is punishable,” he said.

While India’s government and law officials sometimes come across as not very tech-savvy, Pranesh Prakash, policy director at the Center for Internet and Society, said that lawmakers in many countries with a much higher Internet penetration are just as challenged by the Internet. And in India, while the laws are strict, people seldom land in jail for Internet-related offenses, he said.

“The detention law in India, sensibly, defaults to ‘bail, not jail,’ ” he said.

Mr. Prakash said he could not offer any global guidelines to avoid being arrested, and concluded that “each forum has its own rules of etiquette, which cannot be codified or enforced by legislation.” Online speech can be disagreed upon and opinions should be made known, since it is only the “natural tendency for people with extreme views to be more vocal online.”

Not surprisingly, the authorities in India who have been involved in arrests insist they are just doing their job, and doing it well. The Tamil Nadu police, for example, said they acted appropriately in Mr. Srinivasan’s arrest.

R. S. Krishna, inspector general for law and order, told the media that the Puducherry police could not be faulted for filing a First Investigation Report, the precursor to filing charges, against Mr. Srinivasan.

“I am very clear that we have acted purely on the basis of the merit of the complaint, in accordance with the rule of law,” he said. “We are right on our part.”