Silly(?) rewrite question
I'm having a problem with a Zope-related Apache rewrite. What I want to do is to run a "normal" Apache server as my www "root" and to have Zope as a subdirectory off from that root. So in other words, I want Zope to be all under the "News" subdirectory of the web server. This seemed like it'd be easy to do, so I simply modified the default rewrite to: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/News/(.*) /usr/lib/cgi-bin/Zope/$1 (this wraps here) [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] </IfModule> At first glance this seems to work fine. If I go to http://localhost/News/ I get the Zope home page just fine. If I go to [...]News/manage/ I get the management screen and can log in as superuser. I can modify things, and I can add objects, *but* if I try to delete or cut an object, I get the error message "Not Found The requested URL /News was not found on this server." Does anyone know what's going on and can whack me with a clue-bat? Am I approaching this in the right way/any other easier ways to accomplish making Zope live in an Apache subdirectory? Any pointers would be greatly appreciated, TIA. Regards, . Randy -- "If the current stylistic distinctions between open-source and commercial software persist, an open-software revolution could lead to yet another divide between haves and have-nots: those with the skills and connections to make use of free software, and those who must pay high prices for increasingly dated commercial offerings." -- Scientific American
Randy Edwards writes:
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/News/(.*) /usr/lib/cgi-bin/Zope/$1 (this wraps here)
Changes RewriteRule ^/News(.*) /usr/lib/cgi-bin/Zope/$1 (this wraps here) And after that deleting should work. Delete and rename don't add / to url before action script and so those URLs don't exist. -- Petri Lankoski Be careful what you wish, kreivi@iki.fi 'cause it may come true http://www.iki.fi/~kreivi/ w.a.s.p PGP: http://www.iki.fi/~kreivi/pgp.txt
Hi Randy, Instead of RewriteRule ^/News/(.*) /usr/lib/cgi-bin/Zope/$1 (this wraps here) Try RewriteRule ^/News(.*) /usr/lib/cgi-bin/Zope$1 (this wraps here) It seems that there are reference to /News and not /News/ and that is why the rewrite rule is not being activated.. Just make sure you do not have directories called /Newsfoo or /Newsbar. since they will be sent to Zope as well. Adonis On Sat, 4 Dec 1999, Randy Edwards wrote:
I'm having a problem with a Zope-related Apache rewrite. What I want to do is to run a "normal" Apache server as my www "root" and to have Zope as a subdirectory off from that root. So in other words, I want Zope to be all under the "News" subdirectory of the web server.
This seemed like it'd be easy to do, so I simply modified the default rewrite to:
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/News/(.*) /usr/lib/cgi-bin/Zope/$1 (this wraps here) [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] </IfModule>
At first glance this seems to work fine. If I go to http://localhost/News/ I get the Zope home page just fine. If I go to [...]News/manage/ I get the management screen and can log in as superuser. I can modify things, and I can add objects, *but* if I try to delete or cut an object, I get the error message "Not Found The requested URL /News was not found on this server."
Does anyone know what's going on and can whack me with a clue-bat? Am I approaching this in the right way/any other easier ways to accomplish making Zope live in an Apache subdirectory? Any pointers would be greatly appreciated, TIA.
Regards, . Randy
-- "If the current stylistic distinctions between open-source and commercial software persist, an open-software revolution could lead to yet another divide between haves and have-nots: those with the skills and connections to make use of free software, and those who must pay high prices for increasingly dated commercial offerings." -- Scientific American
_______________________________________________ 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 )
on 12/4/1999 10:14 AM, technews@egsx.com at technews@egsx.com wrote:
Just make sure you do not have directories called /Newsfoo or /Newsbar. since they will be sent to Zope as well.
Yeah, but I wonder if there is a way to tell the rule to apply this only to DIRECTORIES and not anything in the path.... Sure, this can be worked around wth creative unique namings of paths, but, while convenient, I feel the RewriteRules might be a bit quirky when it comes to Zope. Harry
Hmm, Well since the RewriteRule are written in regex, I think you can say somtheing like this __this is untested__ RewriteRule ^/News/?(.*) .....Zope.cgi$1 The ? means Match 1 or 0 times, hence it should match the /News/ or /News Give it a try... Adonis On Sat, 4 Dec 1999, Harry wrote:
on 12/4/1999 10:14 AM, technews@egsx.com at technews@egsx.com wrote:
Just make sure you do not have directories called /Newsfoo or /Newsbar. since they will be sent to Zope as well.
Yeah, but I wonder if there is a way to tell the rule to apply this only to DIRECTORIES and not anything in the path.... Sure, this can be worked around wth creative unique namings of paths, but, while convenient, I feel the RewriteRules might be a bit quirky when it comes to Zope.
Harry
on 12/4/1999 7:58 PM, technews@egsx.com at technews@egsx.com wrote:
somtheing like this __this is untested__
RewriteRule ^/News/?(.*) .....Zope.cgi$1
This results in all graphics/images on the Zope/Squishdot instance being broken. Bummer :-( Seems that either Squishdot, or Zope really needs some more work, or the RewriteRules really are not as powerful as they are made out to be... I have yet to get a really functional answer to this problem (or a good solution to running Zope with Virtual Servers). Harry
Harry wrote:
on 12/4/1999 7:58 PM, technews@egsx.com at technews@egsx.com wrote:
somtheing like this __this is untested__
RewriteRule ^/News/?(.*) .....Zope.cgi$1
This results in all graphics/images on the Zope/Squishdot instance being broken.
This is a little verbose, but should work... I tested it :-) RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/News$ .../Zope.cgi/ [E=AUTH... RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/News/(.*) .../Zope.cgi/$1 [E=AUTH... Depending on what you do in Zope, you may want to use a SiteRoot to fix up generated paths. Cheers, Evan @ 4-am
on 12/5/1999 7:20 PM, Evan Simpson at evan@4-am.com wrote:
Depending on what you do in Zope, you may want to use a SiteRoot to fix up generated paths.
Ooooh, wow, that looks like what I was looking for, for a solution. Do you have a syntax example for siteroot? Pretty please? Harry
on 12/5/1999 7:20 PM, Evan Simpson at evan@4-am.com wrote:
Depending on what you do in Zope, you may want to use a SiteRoot to fix up generated paths.
Reaso for thirsting for knowledge about SiteRoot, is because going to the /manage screen/path results in broken image links all over the place. Harry
participants (5)
-
Evan Simpson -
Harry -
Petri Lankoski -
Randy Edwards -
technews@egsx.com