This is an automated email from the ASF dual-hosted git repository.

kparisa pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iggy-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 54cf882a fix(site): serve the site's own 404 page on iggy.apache.org 
(#82)
54cf882a is described below

commit 54cf882ae7b02975345ac0d6f2532f380c331099
Author: Justin Mclean <[email protected]>
AuthorDate: Thu Sep 3 17:15:24 2026 +1000

    fix(site): serve the site's own 404 page on iggy.apache.org (#82)
    
    `next build` already emits out/404.html, but the ASF web server never
    uses it: unknown paths get httpd's bare "Not Found" body instead. The
    status code is 404 either way, so this only changes what agents and
    humans read on the way out -- the built page points at /docs,
    /sitemap.xml and /llms.txt, which is the useful part.
    
    Add a root .htaccess with `ErrorDocument 404 /404.html` and copy it into
    out/ alongside .asf.yaml in both the deploy and stage workflows.
    
    Verify on iggy.staged.apache.org before merging: the .htaccess only
    takes effect once published, so it cannot be tested from a local build.
    
    Co-authored-by: Kranti Parisa <[email protected]>
---
 .github/workflows/deploy.yml |  4 +++-
 .github/workflows/stage.yml  |  4 +++-
 .htaccess                    | 23 +++++++++++++++++++++++
 CLAUDE.md                    |  1 +
 4 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 53a38396..51be31b0 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -30,7 +30,9 @@ jobs:
         run: npm run build
 
       - name: Copy ASF config
-        run: cp .asf.yaml ./out/.asf.yaml
+        run: |
+          cp .asf.yaml ./out/.asf.yaml
+          cp .htaccess ./out/.htaccess
 
       - name: Publish Iggy Website to asf-site
         if: github.ref == 'refs/heads/main'
diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml
index a58ab695..8ec5f790 100644
--- a/.github/workflows/stage.yml
+++ b/.github/workflows/stage.yml
@@ -28,7 +28,9 @@ jobs:
         run: npm run build
 
       - name: Copy ASF config
-        run: cp .asf.yaml ./out/.asf.yaml
+        run: |
+          cp .asf.yaml ./out/.asf.yaml
+          cp .htaccess ./out/.htaccess
 
       - name: Publish Iggy Website to asf-staging
         if: github.event_name == 'push' && github.ref == 'refs/heads/staging'
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 00000000..c2733fad
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Served from the site root on iggy.apache.org (published to asf-site).
+#
+# Without this, the ASF web server answers unknown paths with its own bare
+# "Not Found" body and the 404.html produced by `next build` is never used.
+# The status code stays 404 either way; this only replaces the body.
+ErrorDocument 404 /404.html
diff --git a/CLAUDE.md b/CLAUDE.md
index e8dcc364..9d6bdd47 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -59,4 +59,5 @@ No test framework is configured. No linter is configured 
beyond TypeScript stric
 - Push to `main` triggers `.github/workflows/deploy.yml` (also daily cron and 
manual dispatch), which builds and force-orphan-pushes `out/` to the `asf-site` 
branch -> iggy.apache.org.
 - Push to `staging` triggers `stage.yml`, same flow to `asf-staging` -> 
iggy.staged.apache.org. Use it to preview large changes.
 - `asf-site` and `asf-staging` are generated artifacts. Never edit them by 
hand.
+- Both workflows copy `.asf.yaml` and `.htaccess` into `out/` before 
publishing. The `.htaccess` sets `ErrorDocument 404 /404.html`; without it the 
ASF web server answers unknown paths with its own bare "Not Found" body instead 
of the site's 404 page (the status code is 404 either way).
 - Branch-to-URL mapping is configured via `.asf.yaml` (Apache infrastructure).

Reply via email to