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

How to handle and create custom 404 page #306

Open
Jobians opened this issue Sep 5, 2022 · 4 comments
Open

How to handle and create custom 404 page #306

Jobians opened this issue Sep 5, 2022 · 4 comments

Comments

@Jobians
Copy link

Jobians commented Sep 5, 2022

Question

How to handle and create custom 404 page

@f3l1x
Copy link
Collaborator

f3l1x commented Sep 9, 2022

Hi @Jobians.

I would use routes to provide custom 404 page.

{
  "functions": {
    "api/**/*.php": {
      "runtime": "[email protected]"
    }
  },
  "routes": [
    { "src": "/users/(.*)", "dest": "/api/users.php" },
    { "src": "/orders/(.*)", "dest": "/api/orders.php" },
    { "src": "/(.*)", "dest": "/api/error.php" }
  ]
}

@Jobians
Copy link
Author

Jobians commented Sep 9, 2022

@f3l1x

I used this from vercel documentation but it not working

{ "functions": { "api/**/*.php": { "runtime": "[email protected]" } }, "routes": [ { "src": "/(.*)", "dest": "/api/$1" }, { "src": "/(.*)", "status": 404, "dest": "/api/404.php" } ]

@f3l1x
Copy link
Collaborator

f3l1x commented Sep 9, 2022

Can you share where is this example?

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

No branches or pull requests

2 participants