On Saturday 31 October 2015 18:26:20 Robert Munteanu wrote:
> Hi,

Hi Robert,

> I'm trying to create a redirect from / to /content/blog/posts . The way
> I did this was to change the sling:redirect property of / to
> /content/blog/posts.
> 
> However, the redirect ends up being sent to /blog/posts ( /content
> prefix removed ). By debugging I realised that this is removed by the
> ResourceResolver.map() call since there the
> ResourceResolverFactoryActivator URL mappings contain
> 
>   "/:/", "/content/:/", "/system/docroot/:/"
> 
> which means that for the ResourceResolver.map() call /content is
> removed.
> 
> I am not too familiar with that area of Sling, so my questions are:
> 
> 1) Is another ( clean ) way of doing this? I imagine I could redirect
> to /content/content/blog/posts or http://localhost:8080/content/blog/po
> sts, but both seem workardounds
> 
> 2) Does this look like a bug?

you usually don't want /content/ in your external URLs (visible to clients) 
and your resources under /content/blog/posts should be available also under 
/blog/posts. Does it work?

Have you read "Mappings for Resource Resolution"[0]?

Are you playing with a public available example?

Regards,
O.

[0] 
https://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html

> Thanks,
> 
> Robert

Reply via email to