We present and interpret observations of two morphologically homologous flares that occurred in active region (AR) NOAA 10501 on 20 November 2003. Both flares displayed four homologous Hα ribbons and were both accompanied by coronal mass ejections (CMEs). The central flare ribbons were located at the site of an emerging bipole in the center of the active region. The negative polarity of this bipole fragmented in two main pieces, one rotating around the positive polarity by ≈ 110 • within 32 hours. We model the coronal magnetic field and compute its topology, using as boundary condition the magnetogram closest in time to each flare. In particular, we calculate the location of quasiseparatrix layers (QSLs) in order to understand the connectivity between the flare ribbons. Though several polarities were present in AR 10501, the global magnetic field topology corresponds to a quadrupolar magnetic field distribution without magnetic null points. For both flares, the photospheric traces of QSLs are similar and match well the locations of the four Hα ribbons. This globally unchanged topology and the continuous shearing by the rotating bipole are two key factors responsible for the flare homology. However, our analyses also indicate that different magnetic connectivity domains of the quadrupolar configuration become unstable during each flare, so that magnetic reconnection proceeds differently in both events.