diff --git a/.github/default.conf b/.github/default.conf index 3eecab3f..0640a375 100644 --- a/.github/default.conf +++ b/.github/default.conf @@ -52,13 +52,9 @@ server { error_page 404 /error/index.html; location / { - try_files $uri $uri/ @redirects; - } - - location @redirects { if ($new_uri) { return 303 $new_uri; } - return 404; + try_files $uri $uri/ =404; } } \ No newline at end of file diff --git a/src/redirect.njk b/src/redirect.njk index 2d8d9b86..7b35015b 100644 --- a/src/redirect.njk +++ b/src/redirect.njk @@ -6,5 +6,5 @@ parent: root eleventyExcludeFromCollections: true permalink: /redirects.txt --- -{% for page in collections.all | include("data.hideInSitemap", true) | exclude("data.external", true) %} -{{ page.filePathStem | removeLastPathSegment }} https://digital.sbb.ch{{page.data.redirect}};{% endfor %} \ No newline at end of file +{% for page in collections.all | include("data.hideInSitemap", true) | exclude("data.external", true) %}{{ page.filePathStem | removeLastPathSegment }} https://digital.sbb.ch{{page.data.redirect}}; +{% endfor %} \ No newline at end of file