Since the solutions of the fractional differential equations have unbounded derivatives at zero, their numerical solutions by piecewise polynomial collocation method on uniform meshes will lead to poor convergence rates. This paper presents a piecewise nonpolynomial collocation method for solving such equations reflecting the singularity of the exact solution. The entire domain is divided into several small subdomains, and the nonpolynomial pieces are constructed using a block-by-block scheme on each subdomain. The method is applied to solve linear and nonlinear fractional differential equations. Numerical examples are given and discussed to illustrate the effectiveness of the proposed approach.