added an optional redirect parameter to publish_page with tests

fixes #3073