当我的 React App 被放到网络上时出现问题

Problem when my React App is put on the web

我已经创建了我的 React 应用程序,npm run build ... 将我的文件放入 filezilla, 但问题是我有这个错误

Not Found
The requested URL /main was not found on this server.

当我转到 https://clickswinner.alwaysdata.net

以外的页面时

你有什么建议?

Google是你的朋友

这是一篇关于如何修复 Filezilla 的 404 问题的文章 https://medium.com/@christine_tran/deploying-a-simple-react-application-using-ftp-filezilla-dreamhost-1e5ff6b8abd6

尝试创建一个 .htaccess 文件并将其放在服务器的根目录下

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . index.html [L]
</IfModule>