WebHost: redirect old tutorials to new URL (#5319)

* WebHost: redirect old tutorials to new URL

* WebHost: make comment in tutorial_redirect more accurate
This commit is contained in:
black-sliver
2025-08-12 15:38:22 +00:00
committed by GitHub
parent 9057ce0ce3
commit 85c26f9740

View File

@@ -133,6 +133,15 @@ def tutorial(game: str, file: str):
return abort(404)
@app.route('/tutorial/<string:game>/<string:file>/<string:lang>')
def tutorial_redirect(game: str, file: str, lang: str):
"""
Permanent redirect old tutorial URLs to new ones to keep search engines happy.
e.g. /tutorial/Archipelago/setup/en -> /tutorial/Archipelago/setup_en
"""
return redirect(url_for("tutorial", game=game, file=f"{file}_{lang}"), code=301)
@app.route('/tutorial/')
@cache.cached()
def tutorial_landing():