
519 P.2d 435 (1974)
95 Idaho 766
Guy Junior STILL, Plaintiff-Appellant,
v.
The STATE of Idaho, Defendant-Respondent.
No. 10973.
Supreme Court of Idaho.
February 27, 1974.
*436 Jim Doolittle, Caldwell, for appellant.
W. Anthony Park, Atty. Gen., Wm. F. Lee, Deputy Atty. Gen., Boise, for appellee.
DONALDSON, Justice.
This Court is again confronted with the question of whether appellate review of a criminal conviction may be obtained by a writ of habeas corpus rather than through the procedures found in the Uniform Post-Conviction Procedure Act, I.C. §§ 19-4901 to 19-4911.
On April 24, 1967, the petitioner, Guy Junior Still, pled guilty to two counts of first degree murder in the Third District Court, Gem County. He was subsequently sentenced to two consecutive life prison terms. Following his incarceration in the state penitentiary, he apparently filed a prose application with the Third District Court, Gem County, for relief under the Uniform Post-Conviction Procedure Act. The district court, after receiving the state's motion to dismiss the application, notified petitioner of its intention to dismiss the application unless a reply was made within twenty days pursuant to the provisions of I.C. § 19-4906(b). When no reply was forthcoming, the petition was dismissed. Petitioner did not appeal from this dismissal. The record does not disclose the grounds for relief alleged in the application or why it was dismissed.
Petitioner then filed this petition for a writ of habeas corpus in the Fourth District Court, Ada County. In the petition *437 he alleged that the district court of Gem County erred in accepting his pleas of guilty in that they were not entirely voluntary and that he was not adequately represented by his two court appointed attorneys. From the dismissal of the petition on the grounds that a writ of habeas corpus was not the proper procedure, he prosecutes this appeal.
Idaho Code § 19-4901(b) states that the Uniform Post-Conviction Procedure Act is the exclusive remedy for challenging the validity of a conviction or sentence once the time for direct appeal has expired. Because the writ of habeas corpus is a constitutional remedy, Mahaffey v. State, 87 Idaho 228, 392 P.2d 279 (1964), the Act has been construed by this Court as an expansion of the writ. Dionne v. State, 93 Idaho 235, 459 P.2d 1017 (1969). Therefore, substance and not form governs and it is immaterial whether the petition or application is labeled as one for habeas corpus or post-conviction relief. As long as the petition sets forth the legitimate grounds for relief found in I.C. § 19-4901, this Court will consider the proceeding as one under the Act.
Although it doesn't matter whether the proceeding is denominated as one for habeas corpus or for post-conviction relief, it is still necessary that the procedures of the Uniform Post-Conviction Procedure Act be followed. The Act was designed to give the district court which made the initial determinations a chance to correct any mistakes or irregularities that occurred in that court. In addition, that court has before it all the facts required to make such a determination. Therefore, the application or petition for relief must be filed in the district court where the conviction occurred. I.C. § 19-4902.
Petitioner has alleged that he was not adequately represented by counsel and that his confession was not entirely voluntary. These allegations charge a violation of substantial rights found in both the federal and state constitutions, Dionne v. State, supra, and are included in I.C. § 19-4901(a)(1) as grounds for relief. Therefore, this Court will consider the petition as an application filed under the Uniform Post-Conviction Procedure Act. However, because petitioner has failed to follow the procedures found in the Act, this Court must affirm the action of the district court denying the petition. Idaho Code § 19-4902 states that the application for relief must be filed in the district court in which the conviction took place. Petitioner pled guilty and was convicted in the Third District Court, Gem County. He filed his petition for habeas corpus in the Fourth District Court, Ada County. Because he failed to file his petition in the proper district court, his petition was properly denied.
The record before this Court does not disclose why his original application for relief filed in Gem County was dismissed. Neither does it disclose what grounds for relief were alleged in the application. The grounds alleged in the present writ would, if proven to be true, entitle petitioner to relief. See Tramel v. State, 92 Idaho 643, 448 P.2d 649 (1968). Therefore, although petitioner has already filed one application for relief under the Act in the Third District Court, Gem County, and failed to appeal the dismissal of that application, the Court deems it necessary to grant petitioner leave to file another application for relief pursuant to the Uniform Post-Conviction Procedure Act in the Third District Court, Gem County.
The order of the district court denying petitioner's writ of habeas corpus is affirmed and leave is granted to file for relief under the Uniform Post-Conviction Procedure Act in the district court of Gem County. Affirmed.
SHEPARD, C.J., and McQUADE, McFADDEN, and BAKES, JJ., concur.
