reactjs - 反应js,当打开页面时在新标签中显示404以外的主页
问题描述
我加载 url http://reactnext.mohan21.ir并显示我的项目,但是当我在新选项卡中打开http://reactnext.mohan21.ir/about时,它显示 404 错误。我该如何解决这个错误?
解决方案
我使用 htaccess 并在没有 404 的情况下运行
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
推荐阅读
- excel - 使用“格式为表格”过滤行很慢
- mysql - 在 AWS EC2 中连接 MySQL 数据库
- node.js - 为什么我的承诺链是同时运行的,而不是顺序运行的
- perl - Perl 如果带有“+”、“-”、“*”、“/”
- python - Django 从多个函数创建类
- firebase - 如何在firebase中实现这个.htaccess?
- flutter - 当我们并行运行测试时,使用全局顶级变量有什么副作用吗?
- python - NoReverseMatch at ...... in django
- php - localhost 将您重定向了太多次。拉拉维尔
- java - 有没有办法在 swagger-ui 中显示我的 Maven 依赖项中存在的端点