Skip to content

Commit 6cc8e90

Browse files
committed
fix #269 add docs around deployment
1 parent 3731013 commit 6cc8e90

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ It supports all of Solid's SSR methods and has Solid's transitions baked in, so
3030
- [useMatch](#usematch)
3131
- [useRoutes](#useroutes)
3232
- [useBeforeLeave](#usebeforeleave)
33+
- [SPAs in Deployed Environments](#spas-in-deployed-environments)
3334

3435
## Getting Started
3536

@@ -690,3 +691,26 @@ useBeforeLeave((e: BeforeLeaveEventArgs) => {
690691
}
691692
});
692693
```
694+
695+
## SPAs in Deployed Environments
696+
697+
When deploying applications that use a client side router that does not rely on Server Side Rendering you need to handle redirects to your index page so that loading from other URLs does not cause your CDN or Hosting to return not found for pages that aren't actually there.
698+
699+
Each provider has a different way of doing this. For example on Netlify you create a `_redirects` file that contains:
700+
701+
```sh
702+
/* /index.html 200
703+
```
704+
705+
On Vercel you add a rewrites section to your `vercel.json`:
706+
707+
```json
708+
{
709+
"rewrites": [
710+
{
711+
"source": "/(.*)",
712+
"destination": "/index.html"
713+
}
714+
]
715+
}
716+
```

0 commit comments

Comments
 (0)