[DOCU-2830] Add more information on the virtual mappings' evaluation order Created: 07/Sep/23 Updated: 11/Sep/23 Resolved: 11/Sep/23 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Nils Andre | Assignee: | Alex Mansell |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Documentation page URL: | https://docs.magnolia-cms.com/product-docs/6.2/Administration/URI-mapping/Virtual-URI-mapping.html | ||||||||
| Reporter Name: | Nils Andre | ||||||||
| Email: | nils.andre@jobrad.org | ||||||||
| Description |
|
We had troubles in debugging the virtual URI mapping application/evaluation order (for a We would very much appreciate if you update the docs on this. We found a groovy script for debugging, but unfortunately, this did not work with our MultiSite-Configuration: https://gist.github.com/mkgl/c800a005b7ee960351fae1563d7a148f Heaps of thanks and best wishes from the JobRad CMS/Platform team. |
| Comments |
| Comment by Mikaël Geljić [ 08/Sep/23 ] |
|
Hi nandre, Virtual URI mappings' weight depends on two main mapping classes implementations:
Do you by any chance have a combination of "default" and regexp URI mappings? Here's an example debug output to illustrate, from a modifed VirtualUriFilter with debug logs (attaching the patch, most likely I'll file a PR too): DEBUG info.magnolia.virtualuri.VirtualUriFilter : Evaluating Virtual URI mappings for URI /news/tech/2023/august/news.html DEBUG info.magnolia.virtualuri.VirtualUriFilter : └── DefaultVirtualUriMapping[/news/* --> defaultWon]: weight 6 DEBUG info.magnolia.virtualuri.VirtualUriFilter : └── RegexpVirtualUriMapping[/news/(tech/)?([0-9]+)/([a-zA-Z]+)/(.*)\.html --> regexWon/tech/$4/$2/$3]: weight 5 DEBUG info.magnolia.virtualuri.VirtualUriFilter : Best match: DefaultVirtualUriMapping[/news/* --> defaultWon] => defaultWon Hope this helps! |