isLocalUrl now takes relative paths into account