LPS-43808 fix redirections for adding pages from the dockbar and the site administration

Hey Iliyan, there is some js in the first commit that I wanted you to have a look.

thanks!