diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 53a383962..51be31b04 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 a58ab6951..8ec5f7908 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 000000000..c2733fadd --- /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 e8dcc364d..9d6bdd477 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).