WW-4187 correctly identify protocols to recognise if URL is path

This is related to [WW-4187](https://issues.apache.org/jira/browse/WW-4187)