Skip to content

Serve custom 404.html page for 404 error #30

@Adito5393

Description

@Adito5393

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions