stringByStandardizingPath not only gets rid of . and .. in the path

but also remove an initial component of “/private” from the path if the result still indicates an existing file or directory (checked by consulting the file system).

The /private only shows up when running on device (not in simulator) but causes the if (![filePath hasPrefix:wwwDirPath]) check to always fail.

Without this fix, loading files from localhost doesn't work on device