updated to allow for fully customized url replacement