Webloc files serve as pointers to a URL, think of them as browser bookmarks but saved as a file. To generate them on a mac simply type in the URL you want associated with the .webloc file into the URL bar of your browser. Now select the URL text or the favicon to the left of the URL and drag it to your desktop.

Rename the file, move it to wherever you want in your file system and you’re done. Now every time you open the webloc file, you’ll be redirected to that URL.