React JS htaccess路由问题

时间:2019-06-02 09:36:30

标签: reactjs .htaccess

我用React编写的应用程序被告知,我应该将所有内容都定向到index.html。

Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^ index \ .html $ - [L]
RewriteCond% {REQUEST_FILENAME}! -F
RewriteRule. /index.html [L]

就是这样。

我已经在该网站上完成了一个管理面板,但是使用了php。

因此,当我输入example.com/adminPanel时,也会转到index.html。

如何解决此问题。

谢谢。

1 个答案:

答案 0 :(得分:0)

从规则中排除/ adminPanel请求

Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^ index \ .html $ - [L]
RewriteCond %{REQUEST_URI} !^\/adminPanel
RewriteCond %{REQUEST_FILENAME}! -F
RewriteRule. /index.html [L]
相关问题