I still use MAMP sometimes instead of XAMPP, and to avoid this problem of different local and remote file paths, I set up MAMP as a root server. It’s very easy, and only takes a few minutes, and means you can use those universal URLs locally and remotely.
A few links for Windows and XAMPP that might help: