[Zope] location url

J Cameron Cooper jccooper at jcameroncooper.com
Tue Dec 9 16:18:09 EST 2003


garry saddington wrote:

>On Tuesday 09 December 2003 02:56, J. Cameron Cooper wrote:
>  
>
>>garry saddington wrote:
>>    
>>
>>>How can I set it so that the real location url of my Plone site is not
>>>shown in the location bar of the browser but is replaced by something
>>>else?
>>>      
>>>
>>In order of preference: You may set up RewriteRules however you like in
>>an Apache in front of you Zope.
>>    
>>
>I don't have an Apache in front of my Zope so this one is ruled out.
>  
>
You should consider it: it's a very good idea to have something in front 
of Zope, especially if you're doing URL re-writing. RewriteRule is very 
very powerful.

>>to do similar things. It is also possible to over-ride various methods
>>to play tricks with object publishing. (If you don't know which,
>>probably you shouldn't try.)
>>    
>>
>I asked the question because I want to try. If I had approached everything in 
>Zope with an attitude of 'well I don't know, so I won't try' I would not be 
>using it at all and I would hazard a guess that nobody else would either.
>I have searched Zope.org extensively for pointers and when I drew a blank, I 
>naturally thought to ask on the list. A simple have a look at VHM would have 
>done instead of the patronising tone of your reply.
>However, I now have an idea of where I can look for an answer, so I thank you 
>for the reply.
>
I would never suggest that as a general rule, and in fact spend a lot of 
time showing people how to do advanced things. But I cautioned you on 
this point for a very specific reason: modifying publishing and 
traversal is specially tricky and difficult, and much more likely to 
make you swear like a sailor than provide a workable solution. Consider 
tires: Writing Python scripts and templates is like changing your tires. 
Writing new Products is like mounting tires on new wheels. Playing with 
publishing and traversal and such is like manufacturing your own tires. 
When someone asks "how can I get better traction in the rain?" one might 
for completeness add "you can make your own tires with a specially 
hydrophobic rubber (but you probably shouldn't if you don't know how)."

If you want to try, take a look at the source of Products that do this, 
and at the source of the Zope methods that they over-ride or use. That 
should give you the grounding to try things like this, though if you 
manage to really understand the implementation details, hey, you've got 
one up on me.

(Another intermediate suggestion, btw, that sort of belongs with rewrite 
rules and VHM is the traversal_subpath in a Python script. There's a 
good bit of magic you can usually do safely there.)

          --jcc
-- 

"Code generators follow the 80/20 rule. They solve most of the problems, but not all of the problems. There are always features and edge cases that will need hand-coding. Even if code generation could build 100 percent of the application, there will still be an endless supply of boring meetings about feature design."
(http://www.devx.com/java/editorial/15511)





More information about the Zope mailing list