Skip to content

Commit

Permalink
Set up 301 redirect for old direct access URLs (RPB-38)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Nov 22, 2023
1 parent 3ed6fab commit 54862d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/HomeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ public Result authorityDotFormat(final String id, String format) {
return authority(id, format);
}

public Result authorityPl(String name, String db, int index, int zeilen, String s1) {
return movedPermanently(controllers.routes.HomeController.authority(s1, null));
}

public Result authority(String id, String format) {
SearchHits hits = index
.query(String.format("deprecatedUri:\"%s%s\"", AuthorityResource.GND_PREFIX, id), "", "", 0, 1)
Expand Down
2 changes: 2 additions & 0 deletions conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ GET /dataset controllers.HomeController.dataset(format?="")

GET /search controllers.HomeController.search(q ?= "", filter ?= "", sort ?= "", from: Int ?= 0, size: Int ?= 10, format ?= null)

GET /cgi-bin/wwwalleg/:name.pl controllers.HomeController.authorityPl(name, db ?= "rnam", index: Int ?= 1, zeilen: Int ?= 1, s1)

GET /:id.:format controllers.HomeController.authorityDotFormat(id, format)

GET /:id controllers.HomeController.authority(id, format ?= null)
Expand Down

0 comments on commit 54862d5

Please sign in to comment.