Changes code accordingly to the redirections