Oops.  Don't assume delimiter is '/' (also handle '?').