se c'è bisogno di fare una query che ti modifica tutti i link in db basta chiedere. O anche uno script javascript è sufficiente (anche meglio)