Bastia was the capital of Corsica until 1791 . Bastia ( French and Corsican : Bastia ) is a commune in the Haute-Corse department of France located in the northeast of the island of Corsica at the base of Cap Corse . It is also a second-largest city in Corsica after Ajaccio and the capital of the department .