Reactjs 反应+;Redux在Apache2和/var/www/html/MyProject(ubuntu系统)中部署后寻找绝对路径
am使用react+redux和路由器 在路由器路径索引页中,使用/myproject和其他路由器,同时使用/myproject/xxx/yyyy等,如果给出索引路径=“/”则如何在react npm服务器中解决此问题,但不在apache2或任何其他文件中 这是我的代码片段:Reactjs 反应+;Redux在Apache2和/var/www/html/MyProject(ubuntu系统)中部署后寻找绝对路径,reactjs,redux,react-router,Reactjs,Redux,React Router,am使用react+redux和路由器 在路由器路径索引页中,使用/myproject和其他路由器,同时使用/myproject/xxx/yyyy等,如果给出索引路径=“/”则如何在react npm服务器中解决此问题,但不在apache2或任何其他文件中 这是我的代码片段: <Router history={browserHistory}> <Route name="index" path="/Referral" component={App} /> <Route
<Router history={browserHistory}>
<Route name="index" path="/Referral" component={App} />
<Route name="Referral" path="/Referral/details(/:pathParam)" component={UserDetails} />
<Route name="notifications" path="/Referral/notifications" component={Notifications} />
<Route name="report" path="/Referral/report" component={Report} />
<Route name="addpatient" path="/Referral/AddUser" component={AddPatient} />
<Route name="invalidURL" path="*" component={Page404} />
上述代码始终在查找path=“/refloration/xxx”,因为当我转到下一页并返回时,如果您看到path/refloration添加了两次,则path(上一个路径)更改为like。但在create react app提供的npm服务器中,如果没有/reference/也在工作,则不会面临此问题我的意思是,如果我只提供本地主机,则项目名称和索引名称应该匹配,如果我提供/localhost/projectname,则不会工作(索引名称的路径也与项目名称相同)那么它的工作区您可以提供一个链接,当您获得
推荐//推荐/通知
时,您可以使用该链接导航到该页面吗?这很可能是由于您使用的相对链接造成的。