In the paper, we consider a regular fractional Sturm-Liouville problem with left and right Caputo derivatives of order in the range (1/2, 1). It depends on an arbitary positive continuous function and obeys the mixed boundary conditions defined on a finite interval. We prove that it has an infinite countable set of positive eigenvalues and its continuous eigenvectors form a basis in the space of square-integrable functions. Eigenfunctions are then applied to solve 1D and 2D anomalous diffusion equations with variable diffusivity.