【问题标题】:WordPress multisite file not found issueWordPress多站点文件未找到问题
【发布时间】:2021-02-19 20:52:44
【问题描述】:

WordPress 多站点的问题,因为我的主站点是 http://example.com,其他站点是 http://example.com/subsite

问题:

1) 当我点击一个名为test 的菜单项,它来自http://example.com/subsite,它显示file not found

2) 当我登录并单击名为test 的菜单项时,它会完美打开该页面,但是当我编辑该页面以进入该页面上的管理面板时,它会显示file not found

注意(test 页面受密码保护)

3)我从管理面板访问子站点 http://example.com/subsite 然后它显示该站点的管理面板,但它很奇怪,而且没有加载 css 也没有正确加载。

我的 config.php 文件如下

<?php

 define('WP_ALLOW_MULTISITE', true);

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'XXX');

/** MySQL database username */
define('DB_USER', 'XXX');

/** MySQL database password */
define('DB_PASSWORD', 'XXX');

/** MySQL hostname */
define('DB_HOST', 'XXX');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY', XXX);
define('SECURE_AUTH_KEY',XXX);
define('LOGGED_IN_KEY',XXX);
define('NONCE_KEY',        XXX);
define('AUTH_SALT',        XXX);
define('SECURE_AUTH_SALT', XXX);
define('LOGGED_IN_SALT',   XXX);
define('NONCE_SALT',       XXX);
/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix = 'XXX';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define('WP_DEBUG', false);


define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'mydomain.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);




/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

我的 .htaccess 文件

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
# END WordPress

到目前为止我尝试过的解决方案。

https://wordpress.stackexchange.com/questions/246852/wp-admin-not-working-properly-at-wordpress-multisite-with-subdirectories

https://wordpress.stackexchange.com/questions/246852/wp-admin-not-working-properly-at-wordpress-multisite-with-subdirectories/246926

任何帮助将不胜感激。

【问题讨论】:

  • 您好,您可以分享网站网址以便我了解实际问题

标签: wordpress .htaccess config multisite


【解决方案1】:

可能您(或某人)对数据库值进行了手动更改。所有这些问题可能都来自一个问题——你的网站地址在数据库中被弄乱了。

要纠正这个问题,第一个最简单的尝试可能是转到Settings &gt; General 并重新保存站点链接。如果还是不行,你需要进入PhpMyAdmin,检查表中的值:wp_blogswp_sites,左边应该有域名,右边应该有路径。

之后,转到每个子/站点并单击Permalink-&gt;SAVE PERMALINKS,看看它们是否有效。

【讨论】:

  • 是的,我认为 wp_blogs 表存在问题,我在 subsite 之后添加了 / 现在问题 3 已解决并且管理员正在工作,但是当我点击 posts,@987654332 @,media 或子站点管理面板中的任何内容都将其重定向到带有白屏的file not found 所以你能帮我解决这个@T.Todua
  • @raju_eww 现在转到每个站点并一一单击“保存永久链接”,看看它们是否有效。如果没有,请将wp-blogswp-sites 表格列的屏幕截图放在这里,它们的外观(如果需要,只需在屏幕截图上隐藏您的域的几个字母)
  • 只是主 wp-admin 面板工作正常,但子目录站点 wp-admin 正在打开,但是当我单击 PagePostMedia 等任何菜单时,它会显示 File not Found白屏,所以我怎么能设置子目录站点的永久链接,因为我已经为主站点设置了永久链接的保存更改,但是子目录站点我看不到设置,所以我该怎么做
  • 对于wp_blogs 表:imgur.com/a/cYtomXTwp_site 表:imgur.com/a/zzUpJv7 并且还有一个认为我还尝试从两个表的路径中删除最后一个斜杠(/),没有任何运气
  • @raju_eww 多站点需要在wp_blogs 中有结束斜线/。之后,再次尝试“保存”复制链接。我推荐阅读这些文章:wordpress.stackexchange.com/a/324294/33667
【解决方案2】:

在我的情况下,发生错误是因为 nginx 充当反向代理服务器。在 Plesk 下,它可以在 Tools &amp; Settings &gt; Services Management 中停用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-21
    • 1970-01-01
    • 1970-01-01
    • 2017-06-11
    • 1970-01-01
    相关资源
    最近更新 更多