fixed syntax error and ignore empty url parts (double-slashes)