Resolves ~/ in a URL like ~/page.wc or ~/subfolder/page.wc to a site relative path like /wconnect/page.wc or /wconnect/subfolder.wc.

Using ~/ allows for running a site in a virtual directory (ie. base is /wconnect) or in a Root site (ie. base is /) and avoids having to hardcode the site relative path. ~/ figures out the site's base path and adjusts.

It's recommended you always use ~/ paths for any resources for cleaner handling of relative links and resources.

More info this blog post:

Root Relative Paths in Web Connection


Return Value

Adjusted path.


A disk path. Any path prefixed with ~\ replaces the ~\ to the Root path of the server or virtual (ie. using Request.GetApplicationPath()).


ResolveUrl relies on the cUrlBasePath and cVirtualPath properties which are set by the Web server based on the URL based exposed. Older Web Servers don't expose these values and when that's the case the Process configuration in cHtmlPagePath and cVirtualPath. It's recommended you set these vales in the MyApp.ini file for each process class as a fallback.

See also:

Class wwProcess

© West Wind Technologies, 1996-2022 • Updated: 06/07/20
Comment or report problem with topic