[Zope] Apache mod_rewrite module...
Peter Sabaini
sabaini@niil.at
Mon, 22 May 2000 16:47:39 +0200 (CEST)
you might want to use apaches proxy module in conjunction with
mod_rewrite.
from the docs of mod_rewrite
(http://www.apache.org/docs/mod/mod_rewrite.html):
"""
proxy|P' (force proxy)
This flag forces the substitution part to be internally
forced as a proxy request and immediately (i.e., rewriting rule
processing stops here) put through the proxy module. [...]
"""
i have something like:
RewriteRule /(.*) http://stromapp.kleinezeitung.at:8080/$1 [p]
you should make sure you got mod_proxy as it is not compiled in by
default.
have a lot of fun in the voodoo world of mod_rewrite :)
peter.
On Mon, 22 May 2000, Pierre Rougier wrote:
:>
:> > My URL references to Apache
:> > example:
:> > http://margo.pla.fr/intra/machin.html
:> >
:> > and I want to use httpd.conf to transform it (only for html and htm
:> > files)
:> > in
:> >
:> > http://margo.pla.fr/intra/?machin.html (which is my ZServer)
:> >
:> > Does someone know the rewrite I sould use.... regular expression are a
:> > mistery for me....
:>
:> does "intra" represent that it should be represented by zserver? if so,
:>
:> RewriteRule ^/intra/(.*)htm /intra/?$1htm
:> RewriteRule ^/intra/(.*)html /intra/?$1html
:>
:>
:
:Well, thanks mindlace, it helps, in fact, now, I use the following line:
:RewriteRule ^(^([^/]*/)*)([^/]*\.html)$ http://newhost:8080$1?$3
:(this line should be usefull for those who want to redirect any *.html URL
:to your ZServer)
:
:which change the URL like I want. The problem is that it makes a redirect,
:and all my relative addresses in the page are changed too (for instance, my
:.gif are served by zope too, and I don't want to!)
:
:To be clearer, what my product do is:
:
:I address Apache, with for instance:
:http://margo.ina.fr/intra/index.html
:
:then, Apache change the URL to:
:http://margo.ina.fr:8080/intra/?index.html (8080 is my ZServer port)
:
:my zope product construct a new page with informations from the "intra"
:folder, go and search the file ../intra/index.html on the disk, insert it
:to the builded page (by reading the file) and serve it.
:
:The problem is that by doing that, as in the HTML pages, paths are
:relatives, the redirection change all the relative address to the port 8080
:(because the final served URL is on this port), and I want my Images to be
:served by apache....
:
:(I hope I am clear, but it is hard to explain in an email).
:A solution would be to write absolute URL for my images, but I am not
:allowed to do it.....
:
:so, I try....... to use Apache not to redirect, but to go and search the
:result of http://margo.ina.fr:8080/intra/?index.html, in a way which would
:be transparent to the browser....(the printed URL would keep the Apache
:one), and I have to say that untill now, I don't manage to do it...
:
:Well..... thanks for your attention
:
:Pierre
:
:
:_______________________________________________
:Zope maillist - Zope@zope.org
:http://lists.zope.org/mailman/listinfo/zope
:** No cross posts or HTML encoding! **
:(Related lists -
: http://lists.zope.org/mailman/listinfo/zope-announce
: http://lists.zope.org/mailman/listinfo/zope-dev )
:
--
_________________________________________________
peter sabaini, mailto: sabaini@niil.at
-------------------------------------------------