In an about-face after Western pressure, South Africa today rearrested the 45 mercenaries who commandeered an Air India Boeing to flee the Seychelles when their coup attempt failed there Nov. 25.

It has now charged all the mercenaries under the country's tough hijacking law, which carries a mandatory minimum sentence of five years' imprisonment and a maximum of 30 years. The mercenaries were recruited in South Africa and forced the Boeing's pilot to return them here.

As South Africa acted against the 45 yesterday, six barefoot and handcuffed men and a woman accomplice, who were captured during the Nov. 25 coup attempt, were brought before a court in Victoria, capital of the Seychelles, to be charged with illegally importing arms, Washington Post correspondent Caryle Murphy reported.

Initially Pretoria charged only five "ringleaders" of the 45 mercenaries who returned to South Africa with the lesser offense of kidnaping. The rest were freed.

This caused an international outcry, including accusations from Seychelles President Albert Rene that it indicated South African government complicity and U.S. hints of possible severing of air links--a move that would effectively cripple this already isolated nation.

As the major Western powers began applying pressure, the State Department issued a statement hinting at the action on air links under the Bonn declaration on hijacking. South Africa is a signatory to the 1970 Hague Convention, which requires that hijackers be either prosecuted or extradited. In the 1978 Bonn declaration, seven major powers--the United States, Britain, France, West Germany, Italy, Japan and Canada--agreed to end air links with countries breaching the Hague Convention.

In a further move, the U.S. Embassy in Pretoria sent a group at counselor level to the Foreign Ministry to convey Washington's serious concern.

Within days, the minister of justice, Jacobus Coetsee, issued a statement saying the kidnaping charge was "provisional" and that the dossier on the 45 mercenaries had been sent to the attorney general of Natal Province--where the hijacked plane landed--for a final decision on charges.

Prime Minister Pieter W. Botha also gave an assurance that "South Africa is aware of its international obligations and will meet them."

The possibility of the seven signatories of the Bonn declaration jointly approaching South Africa reportedly was considered, but tonight both the U.S. charge d'affaires in South Africa, Howard Walker, and the British ambassador, Sir John Leahy, said this had not been done.

"It became clear to us," said Leahy, "that the South African authorities were not irrevocably committed to their original action, and so we thought it better to give them time to consider the matter further."

The tactic apparently worked, showing South Africa's particular vulnerability on the matter of air links. Already it is denied overflying rights by the whole of black Africa and must fly around the continent to reach the northern hemisphere.

If the seven major Western powers also were to ban its aircraft, its isolation would be complete.

Today the attorney general for Natal, Cecil Rees, announced that he had issued warrants for the arrest of the 45 mercenaries on New Year's day, and that they were being brought before magistrates in various parts of the country today to be formally charged with four indictments under the Civil Aviation Act.

The men, including two Americans, Barry Gibben and Charles Dukes, will appear in a magistrate's court in Durban, Natal, on Jan. 18, when a date will be fixed for their trial in the Natal Supreme Court.

Dukes was badly wounded in the coup attempt.

The men were all released on bail after they surrendered their passports.

Correspondent Murphy added from Victoria, Seychelles:

State Prosecutor Pessy Pardiwalla said the charge of illegal importation of arms was provisional and other charges could be brought later against the seven, who include four South Africans, one Briton and two Zimbabweans.

They were returned to a local prison and ordered to appear again in court Jan 19. A trial date has not yet been set and the next court appearance is likely to be another postponement, according to a Seychellois lawyer retained to defend six of them.

Kieran Shah said he was contacted by a Johannesburg lawyer named Hurwitz and asked to represent the seven. But one of the men, Martin Dolinchek, who is a self-admitted member of South Africa's national intelligence service, said he felt "his government should make the arrangements for his defense," Shah said.

The South African Intelligence Service has admitted Dolinchek worked for them but the government has denied any complicity in the coup attempt. Dolinchek told reporters here after his capture that he had lied to his superiors about his absence from his job, telling them he had gone on a hunting trip.

The seven, who were left behind after their 45 colleagues hijacked an Air India Boeing jet to flee back to South Africa, made their first court appearance before Chief Justice Earle Seaton amid tight security.

The men were barefoot and handcuffed behind their backs. But they appeared in good health, wearing simple cotton shorts and striped cotton shirts.

South African Susan Ingles, 48, was not handcuffed and wore rubber sandals and a two-piece cotton dress. She allegedly handled the money locally for the mercenary operation and came to Seychelles almost a month before the attempt.