[Helma-user] beginner questions

Maksim Lin for technical support mailling lists maksim_lin at ngv.vic.gov.au
Fri May 25 02:13:15 CEST 2007


Hi Phil,

In my production sites, I run helma behind apache (using mod_jk) so I
tend to fix up these kinds of URL remaps with apache.
If you're interested in going down that road, theres an excellent howto
doc on the helma website (http://helma.org/docs/howtos/mod_jk/) plus I
have some notes on modifying those instructions for apache2 if you use
it rather than apache 1.x.

Doing it completely in helma should be possible too.
You could for instance in the Root prototype override getChildElement()
to check for the old url, maybe something like the example code snippet
provided in the reference docs for that method:
 http://helma.zumbrunn.net/reference/core/HopObject.html#getChildElement

done maybe like this:

function getChildElement(name) {
   writeln("req path:"+req.path);
   if (req.path == 'my/special/url') {
     res.redirect(root.href()+'updated/to/SpecialUrl');
   }
   else {
     return this.get(name);
   }
 }

With your second question about mounting the static repository over an
app root url, it doesn't sound like a good idea to aem and doing a quick
test here shows it doesn't seem to work anyways. So I think you might be
better off having a separate "static" mountpoint for your static files -
its probably a bit neater to do that anyways.

And perhaps some of the helma 'old hands' on this list might have better
solutions then mine too...

Maks.
 

> -----Original Message-----
> From: helma-user-bounces at helma.org 
> [mailto:helma-user-bounces at helma.org] On Behalf Of Phil Hagelberg
> Sent: Friday, 25 May 2007 09:23
> To: helma-user at helma.org
> Subject: [Helma-user] beginner questions
> 
> 
> I've got a couple beginner-level questions regarding problems 
> I've run into just setting up a simple blog as a learning exercise.
> 
> First, is there any way to do mod_rewrite-style redirects 
> from within Helma? I've got people subscribed to my feed at 
> the old location, and it would be nice to be able to redirect 
> based on arbitrary rules instead of having to set up such an 
> object hierarchy just for the purposes of redirecting a 
> single URL. Also this would help with permalinks a lot.
> 
> Secondly, is it OK to mount a static repository on top of a code one?
> Ideally I would like to have it check for static files first, 
> then fall through to dynamic handling if nothing's found. 
> This would clean up my url scheme since I'd rather not change 
> all my past entries to match the helma convention of keeping 
> all my static stuff under /static/ but rather have /images, 
> /stylesheets, and /javascript. Is the right thing to do there 
> just to have a separate static mountpoint for /images, etc?
> 
> thanks,
> Phil Hagelberg
> 
> http://technomancy.us <= recently ported to helma 
> _______________________________________________
> Helma-user mailing list
> Helma-user at helma.org
> http://helma.org/mailman/listinfo/helma-user
> 
> 
> 


More information about the Helma-user mailing list