Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom 404 #396

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add custom 404 #396

wants to merge 2 commits into from

Conversation

IHIutch
Copy link
Collaborator

@IHIutch IHIutch commented Nov 24, 2024

Adds a custom 404 page.

Cloudflare doesn't automatically show a 404 page like netlify, so this adds one.

image

Copy link

cloudflare-workers-and-pages bot commented Nov 24, 2024

Deploying maineballot with  Cloudflare Pages  Cloudflare Pages

Latest commit: 52a02e4
Status: ✅  Deploy successful!
Preview URL: https://87e68df4.maineballot.pages.dev
Branch Preview URL: https://add-404.maineballot.pages.dev

View logs

@IHIutch
Copy link
Collaborator Author

IHIutch commented Nov 24, 2024

Looks like this isn't supported at the moment, with Astro's Cloudflare adapter. Tracking withastro/adapters#374

@IHIutch
Copy link
Collaborator Author

IHIutch commented Nov 24, 2024

I was able to get the build working but I'm not sure this is better.

https://add-404.maineballot.pages.dev/404 works correctly, but only because that page is specifically defined like our other pages.

https://add-404.maineballot.pages.dev/four-oh-four renders the Astro 404 default page, but there's no way to get back to the original site. Which I don't think is a better experience than just seeing the homepage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant