%SCRIPTURL{"script"}%
https://twiki.keegel.id.au/twiki/bin/script
%SCRIPTURL{"viewauth"}%/%WEB%/%TOPIC%
which expands to https://twiki.keegel.id.au/twiki/bin/viewauth/TWiki/VarSCRIPTURL2
%SCRIPTURLPATH{"script"}%
instead, as it works with URL rewriting much better