# 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.

ErrorDocument 404 /404.html

# Redirect legacy *.html URLs to the new clean React Router paths.
# Note: URL fragments (e.g. releases.html#news) are never sent to the server,
# so releases.html#news lands on /releases; the old "news" section now lives at
# its own /news route.
<IfModule mod_alias.c>
  Redirect 301 /releases.html /releases
  Redirect 301 /credits.html  /credits
  Redirect 301 /bylaws.html   /bylaws
  Redirect 301 /security.html /security
  Redirect 301 /irc.html      /irc
  Redirect 301 /events.html   /events
  Redirect 301 /lists.html    /mailing-lists
  Redirect 301 /git.html      /version-control

  # No local privacy page anymore — it now points to the ASF privacy policy.
  Redirect 301 /privacy.html https://privacy.apache.org/policies/privacy-policy-public.html
</IfModule>

<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  Header always set X-Frame-Options "DENY"
  Header always set Cache-Control "no-cache, must-revalidate"

  <FilesMatch "\.(?:css|js|mjs|gif|ico|jpe?g|png|svg|webp|avif|woff2?|ttf|otf|eot|pdf)$">
    Header always set Cache-Control "public, max-age=2592000, immutable"
  </FilesMatch>
</IfModule>
