---+ SCRIPTURL -- URL of script(s) Expands to the URL of a script, or the base URL of all scripts ---++ Parameters | *Parameter* | *Description* | *Default* | | ="$script"= | Name of script | | | =web= | Web name to add to URL | | | =topic= | Topic (or Web.Topic) to add to URL | | | Any other parameters to the macro will be added as parameters to the URL ||| ---++ Examples * =%<nop>SCRIPTURL{"view" topic="Cartoons.EvilMonkey"}%= will expand to =%SCRIPTURL{"view" topic="Cartoons.EvilMonkey"}%= * =%<nop>SCRIPTURL{"view" web="Cartoons"}%= will expand to =%SCRIPTURL{"view" web="Cartoons"}%= * =%<nop>SCRIPTURL{"view" topic="Cartoons.EvilMonkey" rev="1"}%= will expand to =%SCRIPTURL{"view" topic="Cartoons.EvilMonkey" rev="1" }%= * =%<nop>SCRIPTURL{"edit" web="Cartoons" topic="EvilMonkey" t="%<nop>GMTIME{"$epoch"}%"}%= expands to =%SCRIPTURL{"edit" web="Cartoons" topic="EvilMonkey" t="%GMTIME{"$epoch"}%"}%= * =%<nop>SCRIPTURL%= expands to =%SCRIPTURL%= * =%<nop>SCRIPTURL{script}%= expands to =%SCRIPTURL{script}%= <div class="foswikiHelp"> %H% In most cases you should use [[VarSCRIPTURLPATH][SCRIPTURLPATH]] instead, as it works much better with URL rewriting %H% The =edit= script should always be used in conjunction a =t="%<nop>GMTIME{"$epoch"}%"= parameter to ensure pages about to be edited are not cached in the browser %X% The 'old' way of building URLs using =SCRIPTURL= involved concatenating the web and topic names to the =SCRIPTURL= e.g. =%<nop>SCRIPTURL{"script"}%/Cartoons/EvilMonkey=. This practice is *strongly* discouraged, as it does not correctly handle encoding of the parts of the URL. At the first opportunity you should replace all such URLs with the equivalent =%<nop>SCRIPTURL%{"script" topic="Cartoons.EvilMonkey"}%=, which will handle URL encoding for you. %X% The SCRIPTURL macro does NOT support building =jsonrpc= or =rest= requests with parameters. They should still use the "contatenation" method. This is expected to be fixed in Foswiki 2.2. </div> %STOPINCLUDE% ---++ Related [[VarPUBURL][PUBURL]], [[VarSCRIPTNAME][SCRIPTNAME]], [[VarSCRIPTSUFFIX][SCRIPTSUFFIX]], [[VarSCRIPTURLPATH][SCRIPTURLPATH]]
This topic: System
>
Category
>
UserDocumentationCategory
>
Macros
>
VarSCRIPTURL
Topic revision:
15 Mar 2026,
UnknownUser
(raw view)
Copyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki?
Send feedback