javascript - 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'),
);```
解决方案
答案是有人从开发域中删除了带有简码的页面。所以 /schools 在技术上并不存在。
推荐阅读
- ruby - Sequel中多列上的匹配值列表
- wpf - 在 RadGridView Telerik C# WPF 中一次展开一行
- postgresql - centos7操作系统如何通过命令获取PostgreSQL备份数据库?
- python - 创建一个带有链接的矩阵
- sql-server - 按降序排序并继续使用同一组
- javascript - Javascript fetch 不工作,邮递员工作正常
- svn - 在 macOS Mojave 上使用 sourcetree / git-svn 得到“Can't locate SVN/Core.pm in @INC”
- selenium - 当我们使用现有会话连接到浏览器时,鼠标悬停操作在 selenium 中不起作用
- c - scanf("%d", &num) 的状态为 0 或 1
- c# - ASP .NET Core 2.1 从 appsettings.json 获取变量,无需 Startup.cs