php - 本地 Wordpress 安装正在从 Wordpress 管理仪表板上的 URL 中删除“wp-admin”
问题描述
我正在使用和gulp4
代理本地 Wordpress 安装。我的 Apache 和数据库正在使用. 该项目位于我桌面上的文件夹中,而不是 in文件夹中browsersync
gulp-connect-php
xampp
xamp\htdocs\dev
当我运行gulp
Wordpress 代理时,它会启动并且可以通过启动浏览器来访问:http://localhost:3000/
从那里我可以登录到 Wordpress 管理员:http://localhost:3000/wp-admin
然后我被重定向到 Wordpress 仪表板:http://localhost:3000/wp-admin
从仪表板中,我从左侧菜单中单击的任何链接从 URL 中删除“wp-admin”,因此找不到所需的页面。例如,如果我要单击“插件”,我将被定向到http://localhost:3000/plugins.php
而不是http://localhost:3000/wp-admin/plugins.php
端口8001
是 xampp 将 php.exe 设置为的端口。
我的 Wordpress siteurl 和 homehttp://localhost:8001
在数据库中安装时都默认设置为。
gulpfile.js
//establish vars
var gulp = require("gulp"),
sass = require("gulp-sass"),
postcss = require("gulp-postcss"),
autoprefixer = require("autoprefixer"),
cssnano = require("cssnano"),
sourcemaps = require("gulp-sourcemaps"),
connect = require('gulp-connect-php'),
browserSync = require("browser-sync").create(),
imagemin = require('gulp-imagemin'),
concat = require('gulp-concat'),
rename = require("gulp-rename"),
fs = require("fs"),
uglify = require('gulp-uglify-es').default;
//setup the proxy server and browser-sync
connect.server({
base:'./dist',
port:8001,
keepalive:true
});
browserSync.init({
proxy: "localhost:"+8001,
baseDir: "./src",
open: true,
notify: false
});
// Tell gulp which files to watch to trigger the reload
gulp.watch([
'src/**/*.php'
]).on('change', update);
var update = gulp.parallel(
scss,
js,
moveTheme
);
//compress files, move theme to distribution folder, etc
function scss(){...}
function js(){...}
function moveTheme(){...}
初始化后,gulp 日志
[Browsersync] Proxying: http://localhost:8001
[Browsersync] Access URLs:
-------------------------------------
Local: http://localhost:3000
External: http://192.168.1.17:3000
-------------------------------------
UI: http://localhost:3001
UI External: http://localhost:3001
-------------------------------------
解决方案
推荐阅读
- r - 在 R 中分组和运行 For 循环
- java - 将变量初始化为空是反模式吗?
- javascript - 如何在点击时在文本下方而不是在文本上方显示弹出文本
- r - 对R中的多个向量使用tapply和cumsum函数
- c# - 可以将变量的引用保存在 c# 中的另一个变量中吗?
- javascript - 如何使用 Javascript 更改新选项卡的标题?
- javascript - user.findOne() 总是返回 null
- javascript - 如何按字母顺序调整我的优先级队列?我已经获得了频率,我怎样才能把那个词和这个堆按字母顺序进行比较?
- php - 如何从 WooCommerce 产品页面上的面包屑中删除产品类别
- php - 如何用 PHP 中的另一个文档文本、图像和表格替换文档文件中的内容?