Section 417(2) in The Code of Criminal Procedure, 1973
(2)If any person liable to be imprisoned or committed to custody under this Code is in confinement in a civil jail, the Court or Magistrate ordering the imprisonment or committal may direct that the person be removed to a criminal jail.