404 routing fix, FAQ filter wired, hero swaps on /about/ and /services/
What was done
1. 404 routing fix (public/.htaccess)
Added ErrorDocument 404 /404.html at the top of the file. Apache was hitting an unknown URL, failing to find a default ErrorDocument, and falling through to its hardcoded “Not Found / Additionally a 404 Not Found error was encountered while trying to use an ErrorDocument” message — the textbook symptom of no ErrorDocument directive at all. Astro emits its branded 404 to dist/404.html (flat, not in a directory) so the path is exactly /404.html.
2. Site Map button on the 404 page (src/pages/404.astro)
Added a middle CTA between the existing “Back to home” and “Tell us what you needed” buttons:
<a href="/search/" class="btn btn-secondary">Check out the Site Map →</a>
The original “Tell us what you needed” demoted to btn-tertiary so the visual hierarchy reads home -> sitemap -> contact (decreasing prominence).
3. /dev-iq/faqs/ filter pills wired up (src/pages/dev-iq/faqs/index.astro)
Pills (All / Civil Engineering / Land Planning / Multifamily / Commercial / Master Planned) were rendered as buttons with no behavior. Added:
data-filterattribute on each pilldata-categoryattribute on each.faq-card- An
is:inlinescript that toggles.active+aria-pressedon the clicked pill and hides cards whose category doesn’t match. “All” shows everything. - An empty-state
<p>that surfaces if a filter matches zero cards (graceful for categories with no published articles yet)
Why inline JS: the project’s CLAUDE.md prefers no client-side JS, but interactive filtering is the case the rule explicitly carves out as “absolutely necessary.” Script is ~20 lines, no framework, no build cost.
4. Hero swaps
/about/->bailey2.png(wasoffice4.png)/services/->services2.png(wasservices4.png; user typed “service2.png” - resolved to the actual filenameservices2.png)
Why
Items came from a single user pass after live testing:
- Live 404 was Apache’s default text page, not Bailey’s branded one
- The branded 404 had no path forward to the curated sitemap (
/search/is the no-JS fallback list of every page) - FAQ filter pills looked clickable but did nothing
- Two hero images needed swapping
Verification
npm run build clean.
dist/.htaccessopens withErrorDocument 404 /404.htmldist/404.htmlexists and renders Bailey’s branded “off the grid” page with three CTAsdist/dev-iq/faqs/index.htmlcontainsdata-faq-filtersattribute and the inline script (filter JS shipped)/about/and/services/heroes confirmed swapped at source
Operator follow-up
After re-uploading dist/:
- Visit a fake URL like
https://baileyengineers.com/this-page-does-not-exist— should now serve the branded 404 page (was Apache default) - Click filter pills on
https://baileyengineers.com/dev-iq/faqs/— cards should filter live - Purge Cloudflare cache so the new
.htaccessdirective takes effect immediately
Files affected
public/.htaccess- added ErrorDocument 404 directivesrc/pages/404.astro- added Site Map buttonsrc/pages/dev-iq/faqs/index.astro- data attributes + filter scriptsrc/pages/about/index.astro- hero swap to bailey2.pngsrc/pages/services/index.astro- hero swap to services2.pngsrc/content/devlog/2026-04-28-404-faq-filter-hero-swaps.md- this entry