diff --git a/build_versions.sh b/build_versions.sh
index 4f774cc..87ee0a4 100644
--- a/build_versions.sh
+++ b/build_versions.sh
@@ -186,21 +186,30 @@ if [[ "$CURRENT_BRANCH" != "main" ]]; then
mkdir -p "$OUTDIR/$PREVIEW_TAG/_static"
cp "$SRCDIR/_build/latex/SGWirelessDocs.pdf" "$OUTDIR/$PREVIEW_TAG/_static/SGWirelessDocs.pdf"
- # Root redirect → preview
+ # Root redirect → preview (absolute URL so it can't accumulate when
+ # Amplify rewrites a 404 to this page while keeping the requested URL).
cat > "$OUTDIR/index.html" << EOF
-
+
Redirecting…
- Redirecting to ${PREVIEW_TAG}…
+ Redirecting to ${PREVIEW_TAG}…
EOF
+ # Stable, version-independent downloads (same as the production build)
+ # so preview deployments can validate the permanent /downloads/ path.
+ if [[ -d "$SRCDIR/_static/downloads" ]]; then
+ mkdir -p "$OUTDIR/downloads"
+ cp -r "$SRCDIR/_static/downloads/." "$OUTDIR/downloads/"
+ echo "Published stable downloads to $OUTDIR/downloads"
+ fi
+
echo ""
echo "=== Done — preview build in $OUTDIR/$PREVIEW_TAG ==="
exit 0
@@ -267,22 +276,35 @@ for TAG in "${TAGS[@]}"; do
done
# -------------------------------------------------------------------
-# Root redirect → latest version
+# Root redirect → latest version (absolute URL so it can't accumulate
+# when Amplify rewrites a 404 to this page while keeping the URL).
# -------------------------------------------------------------------
cat > "$OUTDIR/index.html" << EOF
-
+
Redirecting…
- Redirecting to ${LATEST}…
+ Redirecting to ${LATEST}…
EOF
+# -------------------------------------------------------------------
+# Stable, version-independent downloads.
+# Files placed in _static/downloads are also published at the site root
+# under /downloads/ so external sites can link to a permanent URL
+# that does not change when the latest version bumps.
+# -------------------------------------------------------------------
+if [[ -d "$SRCDIR/_static/downloads" ]]; then
+ mkdir -p "$OUTDIR/downloads"
+ cp -r "$SRCDIR/_static/downloads/." "$OUTDIR/downloads/"
+ echo "Published stable downloads to $OUTDIR/downloads"
+fi
+
echo ""
echo "=== Done — output in $OUTDIR ==="
echo " Latest: $LATEST"
diff --git a/wget-output.txt b/wget-output.txt
deleted file mode 100644
index e1c1df1..0000000
--- a/wget-output.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Spider mode enabled. Check if remote file exists.
---2026-04-17 15:43:32-- https://mjong2025-patch-1.d16ocb2pu63ur6.amplifyapp.com/preview/index.html
-Resolving mjong2025-patch-1.d16ocb2pu63ur6.amplifyapp.com (mjong2025-patch-1.d16ocb2pu63ur6.amplifyapp.com)... 143.204.1.7, 143.204.1.26, 143.204.1.122, ...
-Connecting to mjong2025-patch-1.d16ocb2pu63ur6.amplifyapp.com (mjong2025-patch-1.d16ocb2pu63ur6.amplifyapp.com)|143.204.1.7|:443... connected.
-HTTP request sent, awaiting response... 401 Unauthorized
-
-Username/Password Authentication Failed.
-Found no broken links.
-