[Zope] Why base href?
Jim Fulton
jim@digicool.com
Thu, 10 Jun 1999 19:25:21 +0000
Alexander Staubo wrote:
>
> You turn it off -- just comment out some code in HTTPResponse.py -- but
> who knows what the side effects might be.
It will break lots of things.
> I asked about this some time
> ago and my impression was that nobody knows exactly why it's there.
I do. :)
Zope often adds steps to the URL path, for example when handling:
- index_html,
- :method form variables,
- Special HTTP methods
(snip)
> >When Zope is used in combination with Apache and Apache is
> >configured to
> >rewrite incoming requests to a Zope folder that is not the
> >root folder, this
> >will cause trouble if there are any relative URLs in the
> >documents. The way
> >Zope determines the URL in the base href in combination with
> >the way Apache
> >rewriting works will often, after clicking around the site a
> >few times, lead
> >to something like
> >www.mysite.org/mysiteroot/mysiteroot/mysiteroot/somedoc in
> >the address line of the browser. It looks ugly, it tricks the
> >browser from
> >caching documents properly and visited links will look unvisited.
The right way to deal with this is to get Zope to participiate in the
rewriting.
For example, if you get Apache to rewrite:
http://foo.com
to
Zope/foo
then Zope needs to be told that (for whichever
requests apply):
the Server URL is: http://foo.com
and
any URLs that begin: Zope/foo should
have the Zope/foo removed.
This doesn't just impact the base HREF. It also
impacts special variables like URLx.
Jim
--
Jim Fulton mailto:jim@digicool.com
Technical Director (888) 344-4332 Python Powered!
Digital Creations http://www.digicool.com http://www.python.org
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission. Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.