My react application is working fine on localhost but when after i deployed it in gh-pages or surge it does not give me to move among pages using URL.
- This is the project repo link
- Demo url here
users can go to signup page by clicking menuItem of top right corner. but If user use http://chat.susi.ai/signup/ URL, it gives 404 page
I tried several solutions from internet but didn't work.
Next question is : I created a 404 page to show up when user tries to move to broken links.It works fine in localhost. but not in production. I tried this solution but nothing changed.
this is part of my index.js file
const App = () => (
<Router history={hashHistory}>
<MuiThemeProvider>
<Switch>
<Route exact path="/" component={ChatApp} />
<Route exact path="/signup" component={SignUp} />
<Route exact path="/logout" component={Logout} />
<Route exact path="/forgotpwd" component={ForgotPassword} />
<Route exact path="*" component={NotFound} />
</Switch>
</MuiThemeProvider>
</Router>
);
ReactDOM.render(
<App />,
document.getElementById('root')
);
If someone can suggest good solution with sample code for my problems that would be really helpful for me.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…