Add missing urlencoding to base/webroot.

This fixes URL generation when PHP_SELF or the request path contains
special characters.