Re: [Zope] Apache mod_rewrite module...

2000-05-22 Thread Pierre Rougier


  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  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Apache mod_rewrite module...

2000-05-22 Thread mindlace

Pierre Rougier wrote:
 
 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

What I think you need to do is use SiteAccess so that it strips out the
port.  You can use an access rule like so:
dtml-let basename="_.string.join(_.string.split(HTTP_HOST,
':')[-2:-1])"
  dtml-call "REQUEST.set('SiteRootBASE','http://'+basename)"
/dtml-let

Then, zope will generate all its links with a base that excludes the
port, so Apache will always get the request and apply its rewrite
rules.  You have to do this, because zope always adds a base url tag to
pages, so relative URL's think they go to zope.

Hope that helps,

--
ethan mindlace fremen
Zopista Community Liason

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Apache mod_rewrite module...

2000-05-22 Thread mindlace

mindlace wrote:

 What I think you need to do is use SiteAccess so that it strips out the
 port.  You can use an access rule like so:
 dtml-let basename="_.string.join(_.string.split(HTTP_HOST,
 ':')[-2:-1])"
   dtml-call "REQUEST.set('SiteRootBASE','http://'+basename)"
 /dtml-let

You may have to change the string.split if the subdomain is important.

~ethan

___
Zope maillist  -  [EMAIL PROTECTED]
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 )