Using a vanity URL / virtual host address like http://mysub.stanford.edu with a Foswiki is pretty straightforward. Assuming that your Foswiki installation's view script is at http://www.stanford.edu/path/to/cgi-bin/wiki/bin/view, then
Note that this also works with https protocols. (You might have to request https proxying from the IT.)
And since Foswiki is a fork of TWiki, these instructions should also apply to TWiki installations.