Respect `SCRIPT_NAME` when using `redirect` with a relative path

Example:
    # application routes.rb
    mount BlogEngine => '/blog'

    # engine routes.rb
    get '/admin' => redirect('admin/dashboard')

This now redirects to the path `/blog/admin/dashboard`, whereas before it
would've generated an invalid url because there would be no slash between
the host name and the path. It also allows redirects to work where the
application is deployed to a subdirectory of a website.

Fixes #7977
(cherry picked from commit 9dbd208562ccd3d68009a72d37cbfe29b94f98c4)

Conflicts:
	actionpack/CHANGELOG.md