Function cleans up url paths (without domain) by ensuring they start with a single slash and removing double slashes.