Host React JS App to Cloud Pages
Cloudpages does NOT support SPA rewrites like:
/about → /index.htmlThere is:
- No .htaccess
- No rewrite rules
- No fallback routing
So BrowserRouter-style routing WILL break on refresh.
Solution: Must use hash-based routing in TanStack Router.
URLs will become:
/fzfsw1qky40/#/
/fzfsw1qky40/#/aboutFirst, you have to build with run command:
pnpm buildIf build successfull, you'll see dist folder. Open index.html and copy all content, then paste to your CloudPages landing page.