Skip to content

Broken redirect of /concepts/manifest #307

@dcarley

Description

@dcarley

https://flox.dev/docs/concepts/manifest (no trailing slash, as it appear in the manifest.toml template) incorrectly redirects to https://flox.dev/docs/environments/#manifesttoml

It works locally because mkdocs serve returns a server-side redirect to add the trailing slash:

% http :8000/docs/concepts/manifest
HTTP/1.0 302 Found
Content-Length: 0
Date: Wed, 13 Aug 2025 11:54:21 GMT
Location: /docs/concepts/manifest/
Server: WSGIServer/0.2 CPython/3.11.9

It doesn't work in production because concepts/manifest/index.html is served up from the context of concepts/ which results in a client-side redirect to concepts/../environments/:

% https flox.dev/docs/concepts/manifest
HTTP/1.1 200 OK
…

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Redirecting...</title>
    <link rel="canonical" href="../environments/#manifesttoml">
    <script>var anchor=window.location.hash.substr(1);location.href="../environments/#manifesttoml"+(anchor?"#"+anchor:"")</script>
    <meta http-equiv="refresh" content="0; url=../environments/#manifesttoml">
</head>
<body>
You're being redirected to a <a href="../environments/#manifesttoml">new destination</a>.
</body>
</html>

In production the trailing slash is added client-side after the page first loads:

<script>
(function() {
let url = new URL(window.location.href);
if (url.pathname.slice(-5) !== ".html" && url.pathname.slice(-1) !== "/") {  
  window.location.replace(window.location.href + "/");
}
}())
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions