History of Rioja
The geographical situation of the town in the Andarax River Valley, a topography of easily defendable mounds between the river and the Sierra Alhamilla, has favoured settlements of various civilizations since the third millennium BC.
After the conquest of the Kingdom of Granada by the Catholic Monarchs, Rioja joined the Crown of Castile in 1489. Together with Gádor and Quiciliana, it became part of the jurisdiction of Almería. As of 1490, the uprisings and the rupture began due to the repression, which culminated in the distribution of the lands of Almería, including those of Rioja.
After the uprising of the Moors of Granada in 1568, and its subsequent repression by Don Juan de Austria (who, together with the Marquis de los Vélez, dyed these lands with blood) 90% of the Moorish population was expelled at the hand of the Crown.
At the end of the sixteenth century, Rioja only had 94 people who divided up the ancient lands of the Moors. At this time, Rioja formed a town, although Gádor managed to increase its own term at the expense of its neighbouring territories. In the book of felling, demarcation of terms and distribution of Rioja, which is kept in Granada and dates to 1572, the town was part of a single municipality, together with Gádor and the former Quiciliana.
On April 17, 1570, Don Juan de Austria stayed a night in Rioja, passing to Santa Fe de Mondújar, giving a period of 20 days for the Moors to be reduced. At this time, Rioja was incorporated, together with Quiciliana, into Gádor until 1635 when it regained its independence as a municipality.