What is the ruling if one swears by something other than Allah?
General Chapter
Al-Mughni
Book of Oaths
Primary text
If one swears by something other than Allah, they should seek forgiveness from Allah Almighty or mention Allah, based on the Prophet's command that whoever swears by Al-Lat or Al-Uzza should say, "There is no god but Allah." This rectification is necessary because swearing by other than Allah is a bad deed (sayyi'ah), and a good deed (hasanah) wipes out the bad deed, in accordance with the verse, {Indeed, good deeds drive away bad deeds} (Quran 11:114). It is also categorized as Shirk because it involves elevating something other than Allah with an honor resembling the glorification due to the Lord, thus requiring the utterance of *La ilaha illa Allah* (There is no god but Allah) as a declaration of Tawhid (monotheism) and disavowal of Shirk.
Supporting text
Imam Shafi'i stated that whoever swears by other than Allah should say, "Astaghfirullah" (I seek Allah's forgiveness).