If you use plus characters "+" instead of spaces then it works as is. For example try searching
dir yonkers+ny long+island+ny
That's because FARR will detect the two parts as whole strings and the website will treat + in the URL as spaces.
Alternatively you can tweak the regex pattern in FARR to require quotes around the to and from stringsalias regex:
^dir "(.*)" "(.*)"$alias results:
To: $$1 From: $$2 | https://www.openstreetmap.org/directions?to="$$1"&from="$$2"
To use that you would type in the FARR searchbox
dir "yonkers ny" "long island ny"
Note that you can keep both aliases, the one which requires quote marks and the one without, active at the same time. Because only one will trigger depending on if you type the quotemarks or not.
That would look something like this