I am currently migrating a multi-language website to Magnolia. In the process 
the location (URL) of some pages has changed. I am trying to setup 
VirtualURIMapping to redirect requests to the old URLs to the new ones. For 
example, the old page /de/team is now available under /team (German is the main 
language) and I want users that still access /de/team (through bookmarks, etc.) 
to be redirected to /team.

I tried to achieve this using the following configuration.

[code]
class:info.magnolia.cms.beans.config.DefaultVirtualURIMapping
fromURI:/de/team
toURI:permanent:/team
[/code]

Unfortunately, requests to /de/team are not redirected. I verified that the 
configuration is in the right place and gets picked up by Magnolia, by changing 
it to the following and making sure that requests to /test are redirected to 
/team.   

[code]
class:info.magnolia.cms.beans.config.DefaultVirtualURIMapping
fromURI:/test
toURI:permanent:/team
[/code]

My current understanding of the problem is that the language path segment /de 
gets stripped from the URI ("currentUri") stored in the AggregationState while 
the request is processed in the I18nContentSupportFilter, which is applied 
before the VirtualUriFilter. Then, in the VirtualUriFilter, the updated URI 
without the language path segment is used to look up mappings in the 
VirtualUriManager. Of course, the updated URI does not match the fromUri set in 
the virtual URI mapping configuration and therefore no mapping is applied. 

To verify this theory, I temporarily changed the order of the 
I18nContentSupportFilter and the VirtualUriFilter in the filter chain (which is 
not recommended). After changing the order, the redirect from /de/team to /team 
works as expected.

As I do not want to break anything by changing the filter chain configuration, 
the question is if it is possible to achieve what I described above using 
Magnolia's virtual URI mapping and standard configuration?

Thanks for any help/insights on this and best regards

Reto

PS:
I think the problem is probably related to the virtual URI mapping problem 
descriped in this post 
[url]https://forums.magnolia-cms.com/forum/thread.html?threadId=b3117667-2b53-47f7-ad72-a7d039bb66bd[/url]

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=8ea4b06b-ab7d-4943-a115-5a924c17b488


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <user-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to