简体   繁体   中英

React application deploying with sub-domain is not working

I am little bit trouble in my react application. I developed two seperate project in react one for front end and another for admin dashboard. Now I want to host them like following:

www.example.com and www.example.com/admin

Hence if I upload two different react project in subdomain it gives me 404 error and it should be. I used two separate project for two different design implementation as react can serve one index html only in a project. I googled a lot about this but can not taking in a final situation . If anyone can suggest me in a good way it would be thankful.

You have to make some changes on your router. I think this blog post would help you

https://medium.com/@svinkle/how-to-deploy-a-react-app-to-a-subdirectory-f694d46427c1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM