Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Allow server side redirect on 404 / 500 error. #955

Open
@thebells1111

Description

@thebells1111

Is your feature request related to a problem? Please describe.
I can't figure out how to redirect to the index page on a 404 error without using client side routing after onMount.

Describe the solution you'd like
A way for the server to detect a status code and redirect to the desired route .

Describe alternatives you've considered
Perhaps implementing some sort of preload this.redirect in the _error.svelte template that also has access to the status code so the redirect can be based on the status code.

How important is this feature to you?
I think for certain apps, i.e. a timesheet app for logging employee time, having all 404 routes lead to the index (which is the timesheet page) leads to a cleaner feeling app. On some apps, going to a 404 and having to click out of it can feel clunky or like something is broken (which in a way is), but redirecting to main page makes the app feel more polished.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions