How to setup apache server for React route?

前端 未结 9 1104
无人共我
无人共我 2020-12-08 10:04

I have my react app running great on my local dev server but it did not work when I dump my production ready files straight into Apache\'s htdocs directory:

Here is

9条回答
  •  没有蜡笔的小新
    2020-12-08 10:42

    Seems like this link (https://gkedge.gitbooks.io/react-router-in-the-real/content/apache.html) is just what you need...

    This piece of configuration is helpful for SPAs :

    This tells Apache to serve any files that exist, but if they don't exist, just serve /index.html rather than a 404: not found

    Hope that solves your problem !

提交回复
热议问题