[opencms-dev] opencms 6 | problem mapping urls (w/o apache)
Claus Priisholm
cpr at codedroids.com
Wed Jul 26 15:06:01 CEST 2006
Joachim Zittmayr wrote:
> hi claus, hi christian!
>
> thanks for your answers, actually this was what i was looking for.
>
> BUT: unfortunately (it came to my mind a few thoughts later), if i use
> such a url rewriting, i'd have to re-implement all the link handling
> stuff for the html-editors and widgets as well, e.g:
>
> from the web-user's perspective: a link http://server/nice_uri is mapped
> to http://server/ugly_uri?with=parameters.
>
> but then the problem resides on the 'other side' (editor's perspective):
> if an ugly link http://server/ugly_uri?with=parameters (another resource
> in the vfs) is added in an html editor, a nice link
> http://server/nice_uri should be created automatically.
>
> has anybody implemented sth like this?
>
> best regards!
> joachim
>
It is a different story if you need it both ways. So the scenario would
be that when your editor generates well known ugly urls (by some
definition), then these should automatically be changed into a
different/nicer urls which then are returned to the users browser.
And then the rewriting can turn a nice'd url back into an ugly ditto
once the user request the former.
I don't know if there is a way to alter the behaviour of <cms:link> (or
rather core methods that handle the link transformation, as I assume it
has to work for links entered into free text pages as well) without
hacking the core. But it would certainly be a place this kind of magic
could happen.
An alternative would be to handle this do as you've already suggested,
i.e. to make a servlet filter. This should work but will add an overhead
as you must parse the entire HTML file upon return from OpenCms. I am
doing something similar with a filter that uses HTMLParser to parse the
HTML from OpenCms and then alters the mailto-links - on modern hardware,
working on pages with 500-1000 words and not particular complex HTML,
the processing takes around 5 ms (plus whatever the filter mechanism
uses 'outside' my code)
>
>
>
> On Wed, 26 Jul 2006 09:16:33 +0200, "Claus Priisholm"
> <cpr at codedroids.com> said:
>> Christian Steinert wrote:
>>> Claus Priisholm schrieb:
>>>> If it is a rewrite filter you want, this one might do the trick:
>>>> http://tuckey.org/urlrewrite/
>>>>
>>> Dear Claus
>>>
>>> This looks interesting. Have you had any experience with this?
>>>
>>> It seems to be a redirecter/rewriter like mod_proxy, so if I understand
>>> correctly, then this filter would not change any CONTENT - it would not
>>> rewrite hrefs inside a html page to point to the "nicer" link.
>>> Correct?
>>>
>>>
>>> Christian
>>>
>> As I understand it, UrlRewrite is modelled over mod_rewrite rather than
>> mod_proxy, which - as far as the url rewrite capabilities goes - is a
>> good thing. But it also means that only deals with rewriting the request
>> url, not the content of the returned page.
>>
>> But I am not sure exactly what it is you want - my understanding was
>> that you have:
>>
>> /one/two/three
>>
>> and want such a request to be processed as something like
>>
>> /foobar.jsp?p1=one&p2=two&p3=three
>>
>> This can be done with the rewrite functionality.
>>
>> regards
>> Claus
>>
>>
>>
>>
>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> _______________________________________________
>>> This mail is sent to you from the opencms-dev mailing list
>>> To change your list options, or to unsubscribe from the list, please visit
>>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>> --
>> Claus Priisholm, CodeDroids ApS
>> Phone: +45 48 22 46 46
>> cpr (you know what) codedroids.com - http://www.codedroids.com
>> cpr (you know what) interlet.dk - http://www.interlet.dk
>> --
>> Javadocs and other OpenCms stuff:
>> http://www.codedroids.com/community/opencms
>>
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please
>> visit
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
--
Claus Priisholm, CodeDroids ApS
Phone: +45 48 22 46 46
cpr (you know what) codedroids.com - http://www.codedroids.com
cpr (you know what) interlet.dk - http://www.interlet.dk
--
Javadocs and other OpenCms stuff:
http://www.codedroids.com/community/opencms
More information about the opencms-dev
mailing list