Fix for #9058 and #8941, environment setup of RAILS_RELATIVE_URL_ROOT was actually never used
Minor change to use 1.9 hash syntax
Reuse _generate_prefix to generate the prefix