fixes #5025 URLMapped pages not working when edit

Fixed the issue and committed the code for review, please check it,