首页 > 解决方案 > Wordpress 插件未显示在开发子域中

问题描述

再会!

我有一个 wordpress 插件,我目前正在为第 3 方继续开发。该插件在主网站上运行得非常好,但是一旦我想在子域环境中开始开发和测试,它就会抛出 404。所以 Somesite.com/schools 可以工作,但是 development.somesite.com/schools 会抛出 404

我在插件中添加了路由器的代码。/schools 应该显示该页面,但没有,而且我似乎无法找到在插件中的任何位置写入的 url。

import { render } from 'react-dom';
import { HashRouter, Switch, Route } from 'react-router-dom';
import Home from './components/Home';
import FormPage from './components/FormPage';

const App = () => (
  <HashRouter>
    <Switch>
      <Route exact path="/" component={Home}/>
      <Route exact path="/school/:loginCode" component={FormPage}/>
      <Route exact path="/enter-school-info" component={FormPage}/>
    </Switch>
  </HashRouter>
);

render(
  <App/>,
  document.querySelector('#stp-frontend-page-wrapper'),
);``` 

标签: javascriptreactjswordpressplugins

解决方案


答案是有人从开发域中删除了带有简码的页面。所以 /schools 在技术上并不存在。


推荐阅读