Gay men will no longer be publicly lashed in Indonesia, but the men will still receive the punishment behind closed doors.
Aceh is the only region in the country where Sharia law is in effect and will continue to punish men with the archaic practice - which saw two men whipped 83 times last year, AFP reported.
A gay man and transgender woman were also arrested for "having gay sex" and will face a similar punishment.
Two men are also being detained before going on trial for having gay sex in the country and were arrested on Thursday after vigilantes broke into their room.
According to local reports, Marzuki, the head of the Aceh Provincial Sharia Law Department, said the men confessed to the charges after their mobiles, condoms and a mattress was handed over as evidence.
The current law allows up for to 100 lashes for "morality offences" and, despite no longer lashing in public, journalists and adults will be able to watch the canings - which will take place behind prison walls.
As the new law was passed, a demonstration against holding the lashings away from the public took place outside the government building
Tuwanku Muhammad, one of the demonstrators, said: "If caning is done in prison... we're sure there will be more Shariah violations in Aceh.
"Even now, there are... violations."
Homosexuality has never been illegal in Indonesia, but over the recent years, attitudes towards LGBT people have become more extreme, despite the growth in population.
There is also a movement in the country to ban gay sex and the Indonesian Psychiatrists Association classifies homosexuality, bisexuality and transgender as an illness.