
922 So.2d 236 (2006)
Akeem MUHAMMAD, Appellant,
v.
James CROSBY, Appellee.
No. 1D05-0673.
District Court of Appeal of Florida, First District.
January 10, 2006.
*237 Appellant, pro se.
Charlie Crist, Attorney General, and Tobey Schultz, Assistant Attorney General, Tallahassee, for Appellee.

ON MOTIONS FOR REHEARING, REHEARING EN BANC, CERTIFICATION, AND CONSOLIDATION
PER CURIAM.
Appellant seeks rehearing of the opinion issued in this case on November 7, 2005, and consolidation with another appeal pending in this court, Muhammad v. Decker, 1D05-1208. Appellee seeks rehearing, rehearing en banc, and certification. We *238 grant the motions for rehearing for the purpose of revising this opinion, but deny the relief requested. We withdraw the previous opinion and substitute the following.
Inmate Akeem Muhammad appeals the trial court's denial of his petition for writ of mandamus/certiorari, wherein he asked the court to direct appellee, James Crosby, Jr., Secretary of the Department of Corrections (DOC), to refrain from enforcing a prison rule that requires his face to be clean shaven, which he contends is a substantial burden on his exercise of Islam and thus prohibited by chapter 761, the Religious Freedom Restoration Act of 1998 (RFRA).[1] Muhammad also claims the trial court erred by imposing a lien on his prison trust account in connection with his filing fee in circuit court. We reverse and remand on these two grounds, and affirm the remaining issues without comment.
Section 761.03(1), Florida Statutes (2004), provides that the government "shall not substantially burden a person's exercise of religion, even if the burden results from a rule of general applicability." Section 761.02(3), Florida Statutes (2004), defines "exercise of religion" as "an act or refusal to act that is substantially motivated by a religious belief, whether or not the religious exercise is compulsory or central to a larger system of religious belief." See Warner v. City of Boca Raton, 887 So.2d 1023 (Fla.2004) (holding that forced behavior contrary to a religious belief is a substantial burden on the free exercise of religion). Muhammad is a Muslim and asserts that Islam commands male adherents to wear a beard the size of a fist or the next shorter length possible. Florida Rule of Administrative Procedure 33-602.101(4), however, requires inmates to be clean-shaven and to submit to forced shaving if they refuse. After Muhammad refused to shave on religious grounds, he was sentenced to 30 days of disciplinary confinement, forced shaves, and loss of gain time. This discipline was upheld on administrative appeal and Muhammad continues to be subject to forced shaves.
The trial court denied the petition for writ of mandamus for the reason that Muhammad should have made his request in a suit for declaratory relief. In a previous case, however, the same judge denied a complaint Muhammad filed containing a request for declaratory statement resolving this same issue, and the court ruled that declaratory judgment was not the proper remedy. Muhammad v. Fla. Dep't of Corrs., No.2003-CA-1494 (Fla.Cir. Ct. Mar. 25, 2004). The court below also denied Muhammad's motion to amend his pleading to add a request for declaratory relief. The issue Muhammad wants the court to address is clear. We therefore direct the circuit court to construe his petition for writ of mandamus as one for declaratory relief, and to address the merits of Muhammad's claim under chapter 761.[2]Cf. Mayweathers v. Terhune, 328 F.Supp.2d 1086 (E.D.Cal.2004) (holding that the California State Prison rule requiring inmates to be clean-shaven was not the least restrictive means for achieving a compelling governmental interest, and *239 thus violated Muslim inmates' religious rights under the federal counterpart to RFRA).
We recognize that courts have previously confirmed the validity of those portions of rule 33-602.101(4) that regulate hair length. Harris v. Chapman, 97 F.3d 499 (11th Cir.1996); Fla. Dep't of Corrs. v. Pride, 706 So.2d 133 (Fla. 3d DCA 1998); Brunskill v. Boyd, 141 Fed.Appx.771 (11th Cir.2005). Those cases, however, do not resolve the issue Muhammad raises with regard to beard length, because hair or beards that are never cut, at issue in these cases, may raise significantly greater security concerns than the quarter-inch beard Muhammad seeks to grow. See, e.g., Mayweathers, 328 F.Supp.2d at 1095 ("while it is plausible that altering a six-inch beard, or cutting very long hair, may assist an escapee to elude capture, . . . shaving a half-inch beard likely cannot").
Turning to the second issue, the lower court declared Muhammad indigent and placed a $280 lien on his prison account to cover the court's filing fee, pursuant to the Prison Indigency Statute, section 57.085(5), Florida Statutes (2004). This was error. Section 57.085(10) specifically provides that the statute "does not apply to a criminal proceeding or a collateral criminal proceeding." The supreme court held in Schmidt v. Crusoe, 878 So.2d 361 (Fla.2003), that an inmate's challenge to an action that results in a loss of gain time is a collateral criminal proceeding, because such action effectively lengthens an inmate's sentence. Appellee claims Schmidt does not apply, because Muhammad is serving a life sentence that cannot be shortened. The opinion does not support this construction.
The court stated in Schmidt that the lien requirement was intended to discourage inmates from filing frivolous civil damage suits challenging conditions of confinement, and that nothing in the legislative history showed an intent to apply the law to actions challenging loss of gain time. Id. at 364-65. It is undisputed that DOC calculates Muhammad's gain time, and that he lost gain time as a consequence of his refusal to shave. Under Schmidt, any challenge to discipline that results in a loss of gain time is a collateral criminal proceeding.
AFFIRMED IN PART, REVERSED IN PART, and REMANDED for further proceedings consistent with this opinion.
ERVIN, BARFIELD and VAN NORTWICK, JJ., concur.
NOTES
[1]  We have jurisdiction to review the procedural denial of Muhammad's challenge under chapter 761 by direct appeal. Green v. Moore, 777 So.2d 425 (Fla. 1st DCA 2000).
[2]  Although the trial court may not prohibit DOC from cutting Muhammad's beard, because courts are not authorized to regulate treatment of inmates, the court does have jurisdiction to consider his challenge to the validity of DOC's shaving regulation on religious grounds. See Moore v. Habibullah, 739 So.2d 1281 (Fla. 3d DCA 1999); Singletary v. Duggins, 724 So.2d 1234 (Fla. 3d DCA 1999).
