admin管理员组文章数量:1332361
I'm having a problem getting the "My Sites" option on the toolbar. I've followed the steps on the book WordPress Multisite Administration and every site tutorial which are all the same. And it never shows up. This is on my dev machine running on Docker and I have restarted from scratch several times.
I'm using www.dmohave.gov which is just an entry in my hosts' file:
127.0.0.1 www.dmohave.gov
I first edit wp-config.php with the database settings and for Multisite
define('WP_ALLOW_MULTISITE', true);
I then run through the install and setup my network which gives me the following update to wp-config.php
# define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'www.dmohave.gov');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
and .htaccess in the same root path as wp-config.php
# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
# <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [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]
# </IfModule>
# END WordPress
I also tried
# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [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]
</IfModule>
# END WordPress
In my Apache conf file I use the following:
<VirtualHost *:80>
ServerName dmohave.gov
ServerAlias dmohave.gov *.dmohave.gov
Redirect permanent / /
</VirtualHost>
<VirtualHost *:443>
# The primary domain for this host
ServerName dmohave.gov
# Optionally have other subdomains also managed by this Virtual Host
ServerAlias dmohave.gov *.dmohave.gov
DirectoryIndex index.html index.php
DocumentRoot /var/web/www/build/
ErrorLog ${APACHE_LOG_DIR}/dmohave.gov-error.log
CustomLog ${APACHE_LOG_DIR}/dmohave.gov-access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/selfsigned.crt
SSLCertificateKeyFile /etc/apache2/ssl/selfsigned.key
<Directory /var/web/www/build/>
# Require all granted
# Allow local .htaccess to override Apache configuration settings
# AllowOverride all
Options +FollowSymlinks
AllowOverride All
Require all granted
# Options FollowSymLinks
# AllowOverride All
# Require all granted
</Directory>
# Enable RewriteEngine
RewriteEngine on
RewriteOptions inherit
# Block .svn, .git
RewriteRule \.(svn|git)(/)?$ - [F]
# Catchall redirect to www.example1
RewriteCond %{HTTP_HOST} !^www.dmohave\.gov [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) /$1 [L,R]
# Recommended: XSS protection
<IfModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
Header always append X-Frame-Options SAMEORIGIN
</IfModule>
</VirtualHost>
With the permissions:
Everything loads properly but I just don't get access to "Network Admin" on the top of the toolbar
like this sample
If I go to the following URL: / I get an error
"Multisite support is not enabled."
Solution
OK I figured it out. I added the defines after the following block of code:
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
Once I moved it before that block everything worked
本文标签: quotMultisite support is not enabledquot After Multisite Config Changes
版权声明:本文标题:"Multisite support is not enabled." After Multisite Config Changes 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742318359a2452274.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论