In this paper, a two-dimensional photonic crystal refractive index biosensor based on a ring-shaped cavity has been proposed. It is designed for the diagnosis of malaria-infected red blood cells (RBCs) in the wavelength range of 1130-1860 nm for TM-polarized light. The proposed biosensor consists of two waveguides coupled with one ring-shaped microcavity, which is obtained by removing seven lattice holes, the microcavity is separated from the two waveguides by three holes. The infiltration of the analyte into the ring-shaped cavity changes its refractive index, and this variation of the refractive index of infected and normal uninfected RBCs causes a corresponding wavelength shift at the output terminal. Consequently, a high sensitivity of more than 700 nm/RIU, an ultra-high-quality factor (Q-factor) of up to 10 6 giving a sensor figure of merit (FOM) of up to 10 6 RIU -1 , and a low detection limit of 10 -7 RIU can be achieved for the proposed design. The proposed device has also an ultra-compact size of 9.78 8.84 m 2 that makes it so attractive for lab-on-a-chip applications. The obtained results have demonstrated that the ring-shaped holes configuration provides an excellent optical confinement within the cavity region. The proposed design is simulated using Plane Wave Expansion (PWE) method and Finite-Difference Time-Domain (FDTD) algorithm.