During the mid to late 19th century wars forts seemed to have been effective still but by the start of WW1 they seem obselete, which weapon/tactic/technology caused this? Was it breech loading artillery with high caliber or armour piercing shells? I heard that Hitler's gigantic railway guns were designed to be fired on the fortifications of the maginot line.
During the mid to late 19th century wars forts seemed to have been effective still but by the start of WW1 they seem obsolete
I wouldn't say so; the examples of Liege and the French Fortress Line in WWI demonstrate that fortifications still had a role to play in warfare in the 20th century. In the case of Liege, the defenders managed to delay the German advance greatly, ultimately forcing the Germans to reduce them one fort at a time, resorting to huge 30.5 and 42 cm artillery pieces, with a slow rate of fire. The French Fortress Line forced the Germans to divert through Belgium, while the forts at Verdun proved vital to the defense of that area by the French in 1916.
Subsequently, the Maginot Line forced the Germans to once again divert through Belgium, fulfilling a strategic purpose, while also proving a tough nut for the Germans to crack in 1940. When American forces fought in south-eastern France in 1944, German and French fortifications proved a great obstacle to Patton's 3rd Army, and a great ally to Patch's seventh Army in 1945. I could point to other examples, like the fortifications at Sevastopol, which allowed their Soviet Defenders to draw out the Siege, and also the German Siegfried Line/West Wall.
The best answer I could give is that the proliferation of thermonuclear armaments and jet powered aircraft in the 1950s made such fortifications prime targets in a future war. However, fortifications still played a role even in cold war conflicts, like the Armistice Line and the subsequent DMZ in Korea, and the Bar Lev Line along the Suez Canal during the War of Attrition and the Yom Kippur War in the Middle East.