Re: Retrieve url path (host name plus path)
florent andré <[email protected]>
| Newsgroups | gmane.comp.cms.lenya.user |
|---|---|
| Message-ID | <[email protected]> |
hi,
Here comes my experiences (can be usefull) and my problem
on localhost, no *lenya* proxy stuff here :
- {request:requestURI} give me /lenya/default/live/sitemap.xml
- {request:serverName} :: localhost
- {request:scheme} :: http
- {request:serverPort} :: 8080
- {request:servletPath} :: /default/live/sitemap.xml
- {request-header:host} :: localhost:8080
- so in that case parameter definition is :
{request:scheme}://{request-header:host}{request:requestURI}
* BUT, *with this lenya proxy* definition :
<proxy area="live" ssl="false" url="http://toto.com"/>
* answer for {request:scheme}://{request-header:host}{request:requestURI}
* is : http://toto.com/lenya/killbookmakers/live/sitemap.xml
* Arrggg, not ok ! :)
* so, new test :
* {proxy:{request:scheme}://{request-header:host}{request:requestURI}} :
throw an error
* {proxy:{request:requestURI}} :: /lenya/lenya/toto/live/sitemap.xml
* {proxy:{request:servletPath}} : http://toto.com/sitemap.xml
COOOOLL ! I find it : {proxy:{request:servletPath}}.
So, no generic solution when proxy definition or not...
* no proxy : {request:scheme}://{request-header:host}{request:requestURI}
* proxy : {proxy:{request:servletPath}}
Someone know or can point me a solution for generic definition if i'm
behind proxy or not ??
cheers
[email protected] wrote:
> Hi --
>
> Have you checked out the Cocoon wiki on input modules? The request input
> module should do what you want, e.g.
> {request:requestURI}?{request:queryString} would return the entire URL,
> including request params. If the Apache proxy messes with the headers,
> you can always set ProxyPreserveHost On.
>
> Ref: [ http://wiki.apache.org/cocoon/InputModules ] (and no, it's not
> obsolete, although it says so at the top of the page).
>
> Hope this helped,
>
> /Petteri
>
> On Apr 15, 2010 3:32pm, Florent André <[email protected]>
> wrote:
> > Hi all,
> >
> >
> >
> > As I currently work on google's sitemap generation, I have to know the
> >
> > host name and path of the request.
> >
> >
> >
> > I have a look into inputs modules but I only see one that gave
> information
> >
> > about "lenya document" (required to have an uuid).
> >
> >
> >
> > In my use case, I don't have a lenya doc... Here comes the design main
> >
> > lines :
> >
> >
> >
> > - url finish with sitemap.xml (for example http://example.com/sitemap.xml
> >
> > , http://www.example.com/toto/foo/sitemap.xml)
> >
> >
> >
> > - publication's sitemap.XMAP intercept sitemap.xml ending and mount a
> >
> > sitemap.xmap in seo module
> >
> >
> >
> > - in seo module, I have
> >
> > -- a match on sitemap.xml
> >
> > -- a navigation module generator
> >
> > -- a navigationToSitemap transformer
> >
> >
> >
> > - into this transformer I have to know the entire url for generate a good
> >
> > sitemap.xml, I think to do this throw a
> > value="{anInputModule:key}">
> >
> >
> >
> > The base url retrive have to be "proxyied", have to be the same as the
> >
> > client see...
> >
> >
> >
> > Any help would be great appreciated,
> >
> >
> >
> > Have a good day
> >
> > ++
> >
> >
> >
> > ---------------------------------------------------------------------
> >
> > To unsubscribe, e-mail: [email protected]
> >
> > For additional commands, e-mail: [email protected]
> >
> >
> >