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

Serve custom 404.html page for 404 error #30

Open
Adito5393 opened this issue Jun 6, 2023 · 0 comments
Open

Serve custom 404.html page for 404 error #30

Adito5393 opened this issue Jun 6, 2023 · 0 comments

Comments

@Adito5393
Copy link

Adito5393 commented Jun 6, 2023

Does your preview setup serve a custom 404 html page?

I'm new to Caddyfile format, but shouldn't you also have something like:

handle_errors {
	rewrite * /{err.status_code}.html
	file_server
}

For some reason this was not working with 2.6.4-alpine version and I downgraded to 2.6.3-alpine and it works, partially.
If the request is nested (e.g. localhost:port/some-path/somefile), then the CSS and js files are not found.

Do you think this is an issue with Caddy or Antora 404.html generated file?

EDIT: It looks like the issue was with the 404.html file. The file generated from the Default-UI preview src outputs:

<script id="site-script" src="_/js/site.js" data-ui-root-path="_"></script>
<script async src="_/js/vendor/highlight.js"></script>

And it should be absolute path: src="/_/js/site.js"

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

No branches or pull requests

1 participant