4

Issue with WordPress multisite as i have main site which is http://example.com and other is http://example.com/subsite.

Issues :

1) When i click on one of menu item which is named test and its from http://example.com/subsite its showing file not found.

2) When i'm login and click on menu item named test it opens that page perfectly but when i edit that page to go admin panel on that page it says file not found

Note (test page is password protected)

3) From Admin panel i visit subsite which is http://example.com/subsite then it shows admin panel of that site but its weird and also without loading css and not loading properly.

My config.php file is as below

<?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');

My .htaccess file

# 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

Solutions i tried till now.

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

Any help will be appreciated.

developerme
  • 1,845
  • 2
  • 15
  • 34
raju_odi
  • 1,433
  • 13
  • 29

2 Answers2

2

Probably you (or someone) made manual changes to database values. All these problems probably come from that one problem - your website address is messed up in DB.

To correct that, the first simplest try might be to go to the Settings > General and resave the site links. If that doesn't help, you need to enter in PhpMyAdmin, check the values in tables: wp_blogs and wp_sites, there should be domain name in left and path in right columns separately.

After that, go to each sub/site and click Permalink->SAVE PERMALINKS and see if they will work.

T.Todua
  • 53,146
  • 19
  • 236
  • 237
  • yes i think there was issue with wp_blogs table where i added `/` after `subsite` now issue `3` has been solved and admin is working but when i click on `posts`,`pages`,`media` or anything from admin panel of subsite its redirecting to `file not found` with white screen so could you plese help with this @T.Todua – raju_odi Feb 14 '19 at 04:37
  • @raju_eww now go to each site and click "SAVE PERMALINKS" one by one and see if they will work. If not, please put here screenshot of `wp-blogs` and `wp-sites` tables columns, how they look (just hide your domain's several letters on screenshot if you want) – T.Todua Feb 14 '19 at 08:52
  • just main wp-admin panel working fine but subdirectory site wp-admin opening but when i click on any of menu like `Page`,`Post` or `Media` etc its showing `File not Found` with white screen so how could i set permalink of subdirectory site as i have alredy set save changes for permalink for main site but subdirectory site i can't see settings so how could i do this – raju_odi Feb 14 '19 at 09:11
  • for `wp_blogs` table : https://imgur.com/a/cYtomXT and `wp_site` table : https://imgur.com/a/zzUpJv7 and one more think i also tried to remove last slash(`/`) from path from both table without anyluck – raju_odi Feb 15 '19 at 05:00
  • @raju_eww the multisite needs to have end slash `/` in `wp_blogs`. After that, try to "save" repmalinks again. I recommend to read these articles: https://wordpress.stackexchange.com/a/324294/33667 – T.Todua Feb 15 '19 at 09:39
  • I have added end slash `/` too but no any luck – raju_odi Feb 15 '19 at 09:40
  • @raju_eww I recommend to read the articles on this link: https://wordpress.stackexchange.com/a/324294/33667 – T.Todua Feb 15 '19 at 09:40
  • @raju_eww did you check wp-config.php ? what is the value there of `DOMAIN_CURRENT_SITE` and `PATH_CURRENT_SITE` ? post them (replace domain with `example.com`) – T.Todua Feb 15 '19 at 09:42
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/188468/discussion-between-raju-eww-and-t-todua). – raju_odi Feb 15 '19 at 09:44
0

In my case, the error occurred because nginx was acting as a reverse proxy server. Under Plesk, it could be deactivated in Tools & Settings > Services Management.