site: https://dreamy-sprinkles-ba23e0.netlify.app
repo: GitHub - rebeccapeltz/ionic-react-arcgis: test using react and arcgis in ionic
When I click on the link to my site it add /home. I don’t see this when I run the site locally.
404: Ionic App
Can you help me figure out what is causing netlify to add the /home path (which renders 404)?
clarnx
October 4, 2023, 6:39am
2
Hi @rebeccapeltz , thanks for the post.
In order to fix your problem first of all kindly create an _redirects
file in your public
folder with the content below.
/* /index.html 200
Secondly navigate to your App.tsx
in your src
in the project root and replace the App
variable with the code below
const App: React.FC = () => (
<IonApp>
<IonReactRouter>
<IonRouterOutlet>
<Route exact path="/">
<Home />
</Route>
<Route exact path="/home">
<Redirect to="/" />
</Route>
</IonRouterOutlet>
</IonReactRouter>
</IonApp>
);
The reason for the redirect is because in your App.tsx
file the code on line 34
redirects to /home
when the url path is /
<Route exact path="/">
<Redirect to="/home" />
</Route>
Make the changes and then redeploy.
Let me know the outcome.
Thanks.
1 Like
works perfect now! - thank you for your quick response - send me a link to give you a good rating
Becky
1 Like
clarnx
October 4, 2023, 10:08pm
4
Hi @rebeccapeltz , I really appreciate your kind gesture! I’m truly glad I could assist you, and your thanks means a lot to me