Handle agnostic URLs for older php installs

See http://3v4l.org/Fh746

Rather than requiring and upgrade of PHP, this adds a workaround.