The spontaneous capillary-driven filling of microchannels is important for a wide range of applications. These channels are often rectangular in cross-section, can be closed or open, and horizontal or vertically orientated. In this work, we develop the theory for capillary imbibition and rise in channels of rectangular cross-section, taking into account rigidified and non-rigidified boundary conditions for the liquid-air interfaces and the effects of surface topography assuming Wenzel or Cassie-Baxter states. We provide simple interpolation formulae for the viscous friction associated with flow through rectangular cross-section channels as a function of aspect ratio. We derive a dimensionless cross-over time, T c , below which the exact numerical solution can be approximated by the Bousanquet solution and above which by the visco-gravitational solution. For capillary rise heights significantly below the equilibrium height, this cross-over time is T c (3X e /2) 2/3 and has an associated dimensionless crossover rise height X c (3X e /2) 1/3 , where X e =1/G is the dimensionless equilibrium rise height and G is a dimensionless form of the acceleration due to gravity. We also show from wetting considerations that for rectangular channels, fingers of a wetting liquid can be expected to imbibe in advance of the main meniscus along the corners of the channel walls. We test the theory via capillary rise experiments using polydimethylsiloxane oils of viscosity 96.0, 48.0, 19.2 and 4.8 mPa s within a range of closed square tubes and open rectangular cross-section channels with SU-8 walls. We show that the capillary rise heights can be fitted using the exact numerical solution and that these are similar to fits using the analytical visco-gravitational solution. The viscous friction contribution was found to be slightly higher than predicted by theory assuming a non-rigidified liquid-air boundary, but far below that for a rigidified boundary, which was recently reported for imbibition into horizontally mounted open microchannels. In these experiments we also observed fingers of liquid spreading along the internal edges of the channels in advance of the main body of liquid consistent with wetting expectations. We briefly discuss the implications of these observations for the design of microfluidic systems.