Skip to content

Commit

Permalink
OnlyLang: Permanently redirect all non-language URLs to the primary l…
Browse files Browse the repository at this point in the history
…anguage

For the OnlyLang mapper, instead of mapping non-language URLs to the primary language internally,  redirect to those URLs. For example, redirect /foo/bar to /de/foo/bar
  • Loading branch information
Stefan Bethke committed Mar 1, 2024
1 parent 25847dc commit 17cfc95
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public Collection<? extends HasMetadata> buildLiveResources(SiteMapping siteMapp
ingresses.addAll(ingressBuilderFactory.builder(targetState, liveName(site, "default", suffix), fqdn, tls)
.responseTimeout(responseTimeout)
.uploadSize(uploadSize)
.pathPattern("/(.+)", serviceName).rewrite("/blueprint/servlet/" + siteMapping.getPrimarySegment() + "/$1").build());
.pathPattern("/(.*)", serviceName)
.redirect("$scheme://" + fqdn + "/" + getLanguage(siteMapping.getPrimarySegment()) + "/$1", HttpStatus.MOVED_PERMANENTLY.value()).build());
ingresses.addAll(ingressBuilderFactory.builder(targetState, liveName(site, "seo", suffix), fqdn, tls)
.responseTimeout(responseTimeout)
.uploadSize(uploadSize)
Expand Down

0 comments on commit 17cfc95

Please sign in to comment.