On Thu, 2002-01-31 at 09:33, Geoffrey Talvola wrote:
> This is working for me, even when I forward to a servlet in a different
> directory. Give it a try and let me know if it works.
>
> Perhaps this ought to be added to SitePage.
>
> def siteRoot(self):
> """
> Returns the URL path components necessary to get back
> home from the current location. Works even if you have
> forwarded from one servlet to another.
> """
> req = self.request()
> url = req.pathInfo()
> contextName = req.contextName() + '/'
> if url.startswith(contextName):
> url = url[len(contextName):]
> numStepsBackward = len(url.split('/')) - 1
> return '../' * numStepsBackward
I believe this won't work with mod_rewrite, as Webware isn't given any
access to the original URL.
I believe with a bit more mod_rewrite magic, you can set an
environmental variable to give the original URL. That might be a good
avenue for a more complete siteRoot().
Ian
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss