【问题标题】:page refresh not working while using https使用 https 时页面刷新不起作用
【发布时间】:2016-08-07 08:28:54
【问题描述】:

我们已经使用 react js 框架构建了 UI,并且 html +css + js 代码部署在 apache 2 中。当我浏览网站时,它工作正常,但如果我刷新页面,则会得到 404。有人可以告诉我如何修复它.

【问题讨论】:

  • 你使用单页应用路由器吗?

标签: apache .htaccess reactjs https apache2.2


【解决方案1】:

也许这个答案与你有关:

Apache web server doesn't allow me to refresh on /about but on localhost its working fine

我知道我在第一次设置 react-router 时也遇到了与 HTML5 模式相关的问题。

【讨论】:

    【解决方案2】:

    如果你使用 React-Router,你可能会遇到这个问题:React-router urls don't work when refreshing or writting manually

    您还可以查看the React Router tutorial,了解如何设置生产 Express 服务器。

    【讨论】:

    • 使用 http url 可以正常工作,但是当我使用 https 访问相同的 url 时,我得到 404。
    猜你喜欢
    • 2015-02-16
    • 2022-01-16
    • 1970-01-01
    • 2011-11-30
    • 2023-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-15
    相关资源
    最近更新 更多