NEW YORK (AP) _ A dying AIDS patient can exchange marriage vows in St. Patrick's Cathedral after all, if he and his wife first get premarital counseling at their parish church, a spokesman for the Roman Catholic Archdiocese of New York said Monday.

''It's up to them,'' said Joseph Zwilling. ''If they get the counseling, they can get married at the cathedral.''

''We're quite prepared to do that,'' said David Hefner, who was in New York University Medical Center for treatment of a chest infection. ''We're looking forward to getting married at St. Patrick's.''

David and Maria Hefner were married in a civil ceremony three years ago, but sought permission for a church wedding in the cathedral. Hefner, 38, has said he had homosexual relationships before marrying his wife.

Last week Monsignor James Rigney, rector of the cathedral, canceled the couple's wedding date, which had been set by one of St. Patrick's associate pastors. Rigney said that someone in a ''life-threatening situation'' would receive better premarital counseling at a parish church.

The archdiocese requires all marriage candidates to participate in some form of premarital counseling.

On Sunday, Cardinal John O'Connor - who had been traveling in the Middle East - said he was reviewing Rigney's decision.

''If they would meet the requirements for a church wedding, I would see no problem,'' O'Connor said. ''And if that's determined and the appropriate instructions are given, perhaps best by a parish priest, then I would imagine the rector of the cathedral would welcome them to the cathedral. Certainly, I would personally.''

Homosexual rights groups had complained that Rigney's decision reflected a bias against homosexuals and those suffering from acquired immune deficiency syndrome.

Asked if he felt he had been discriminated against by the church, Hefner said, ''I thought so, but now it seems it's going to be OK.''