[MURLTRANS-39] URLTrans filter should return 404 if lang code does not correspond with URI Created: 04/Feb/24  Updated: 05/Feb/24

Status: In Progress
Project: URL Translation
Component/s: None
Affects Version/s: 6.2.4
Fix Version/s: 6.2.5

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Richard Gange
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 0.75d
Original Estimate: Not Specified

Attachments: PNG File new-configuration.png    
Issue Links:
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Work Started:

 Description   

The problem seems to be limited to the default language but it's possible to make requests to the system where the requested URI does match the requested language.

Consider a site with two languages, english and german. For example there is a hierarchy that looks like this:

  • home (heim)
    • section (sektion)
      • content (inhalt)

A proper request for the german content would be:
http://localhost:8080/dx-core-webapp/de/sektion/inhalt

However, I am also able to access the german content with the default URL:
http://localhost:8080/dx-core-webapp/de/section/content

While both URLs technically make sense it's bad for SEO. The URLTransFilter needs to block the default URL and return a 404. Or at least have a toggle to block the default access.

Notes
It makes sense that the system would respond correctly to a URL with an explicit lang code and a default URI. For example:

The point is with URL translation we are overriding the page nodes names with translations which should be unique.



 Comments   
Comment by Richard Gange [ 05/Feb/24 ]

This ticket introduces a new filter setting and voter.

In order to block the default URIs you can use blockDefaultUrls set true with a LocaleVoter which skips the default language.

Generated at Mon Feb 12 11:09:00 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.