How to setup apache server for React route?

前端 未结 9 1088
无人共我
无人共我 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:47

    If you have to use .htaccess and a sub directory then following works for me.

    Options -MultiViews
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.html [QSA,L]
    

提交回复
热议问题