将 Wordpress 多站点移动到本地主机进行开发
Moving Wordpress multisite to localhost for development
我一直在尝试复制我的多站点域并将其移动到
C:/wamp/www/at-groep
我正确配置了 wp-config.php, .htaccess。我创建了虚拟主机等。我将举例说明我所做的事情。我收到的错误消息是:
If your site does not display, please contact the owner of this
network. If you are the owner of this network please check that MySQL
is running properly and all tables are error free.
Could not find site at-groep.local. Searched for table atgroep_blogs
in database at-groep. Is that right?
What do I do now? Read the bug report page. Some of the guidelines
there may help you figure out what went wrong. If you’re still stuck
with this message, then check that your database contains the
following tables:
atgroep_users - atgroep_usermeta - atgroep_blogs - atgroep_signups
atgroep_site - atgroep_sitemeta - atgroep_registration_log -
atgroep_blog_versions
我检查了桌子是否在那里,它们确实在那里。
虽然我希望看到网站的根页面。
配置如下:
这是我的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /at-groep/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /at-groep/index.php [L]
</IfModule>
这是我的httpd-vhosts.conf
<Directory "C:/wamp/www/at-groep">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/at-groep"
ServerName at-groep.local
Errorlog "C:/wamp/www/ERROR_LOG_AT_GROEP"
TransferLog "C:/wamp/www/TRANSFER_LOG_AT_GROEP"
</VirtualHost>
这是我的wp-config.php
/* Multisite */
define( 'WP_ALLOW_MULTISITE', false );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'at-groep.local' );
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
/* That's all, stop editing! Happy blogging. */
我正在使用 Wampserver 2.5
。
我希望看到多站点在我的本地计算机上运行。有人可以帮我解决这个问题吗?
好的,访问权限的语法在 Apache 2.4 中发生了变化,因此请尝试按如下方式修改虚拟主机定义。同样在我看来,最好将 <Directory>...</Directory>
集放在 <VirtualHost>
部分中。它至少在视觉上链接了 2,尽管按照您的方式进行操作并不违法。
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/at-groep"
ServerName at-groep.local
Errorlog "C:/wamp/www/ERROR_LOG_AT_GROEP"
TransferLog "C:/wamp/www/TRANSFER_LOG_AT_GROEP"
<Directory "C:/wamp/www/at-groep">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Require all granted
</Directory>
</VirtualHost>
如果您真的不想让整个宇宙看到您的开发站点替换
Require all granted
和
Require local
如果您想使用本地网络中的另一台 PC 作为客户端,请使用类似这样的东西
Require local
Require ip 192.168.1
仅使用 4 个四分位数的前 3 个将允许该子网中的任何 ip。
您还需要将域名添加到您的 HOSTS 文件
C:\windows\system32\drivers\etc\hosts
127.0.0.1 localhost
::1 localhost
127.0.0.1 at-groep.local
::1 at-groep.local
阅读和理解也是一个好主意how to move a WP website您可能需要对数据库进行一些更改,因为 WP 存储最初安装站点时使用的 URL并在内部使用它。这可能会在移动网站时给您带来麻烦。
第二次尝试
.htaccess
看起来也不对,因为您定义了虚拟主机而不是子文件夹中的 运行。查看更改 RewriteBase
和 RewriteRule
是否有帮助。
.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
或者看看这个 WP Doc on .htaccess
我不知道你的确切设置所以我不能建议比这更具体的东西。
我一直在尝试复制我的多站点域并将其移动到
C:/wamp/www/at-groep
我正确配置了 wp-config.php, .htaccess。我创建了虚拟主机等。我将举例说明我所做的事情。我收到的错误消息是:
If your site does not display, please contact the owner of this network. If you are the owner of this network please check that MySQL is running properly and all tables are error free.
Could not find site at-groep.local. Searched for table atgroep_blogs in database at-groep. Is that right?
What do I do now? Read the bug report page. Some of the guidelines there may help you figure out what went wrong. If you’re still stuck with this message, then check that your database contains the following tables:
atgroep_users - atgroep_usermeta - atgroep_blogs - atgroep_signups atgroep_site - atgroep_sitemeta - atgroep_registration_log - atgroep_blog_versions
我检查了桌子是否在那里,它们确实在那里。
虽然我希望看到网站的根页面。
配置如下:
这是我的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /at-groep/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /at-groep/index.php [L]
</IfModule>
这是我的httpd-vhosts.conf
<Directory "C:/wamp/www/at-groep">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/at-groep"
ServerName at-groep.local
Errorlog "C:/wamp/www/ERROR_LOG_AT_GROEP"
TransferLog "C:/wamp/www/TRANSFER_LOG_AT_GROEP"
</VirtualHost>
这是我的wp-config.php
/* Multisite */
define( 'WP_ALLOW_MULTISITE', false );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'at-groep.local' );
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
/* That's all, stop editing! Happy blogging. */
我正在使用 Wampserver 2.5
。
我希望看到多站点在我的本地计算机上运行。有人可以帮我解决这个问题吗?
好的,访问权限的语法在 Apache 2.4 中发生了变化,因此请尝试按如下方式修改虚拟主机定义。同样在我看来,最好将 <Directory>...</Directory>
集放在 <VirtualHost>
部分中。它至少在视觉上链接了 2,尽管按照您的方式进行操作并不违法。
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/at-groep"
ServerName at-groep.local
Errorlog "C:/wamp/www/ERROR_LOG_AT_GROEP"
TransferLog "C:/wamp/www/TRANSFER_LOG_AT_GROEP"
<Directory "C:/wamp/www/at-groep">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Require all granted
</Directory>
</VirtualHost>
如果您真的不想让整个宇宙看到您的开发站点替换
Require all granted
和
Require local
如果您想使用本地网络中的另一台 PC 作为客户端,请使用类似这样的东西
Require local
Require ip 192.168.1
仅使用 4 个四分位数的前 3 个将允许该子网中的任何 ip。
您还需要将域名添加到您的 HOSTS 文件
C:\windows\system32\drivers\etc\hosts
127.0.0.1 localhost
::1 localhost
127.0.0.1 at-groep.local
::1 at-groep.local
阅读和理解也是一个好主意how to move a WP website您可能需要对数据库进行一些更改,因为 WP 存储最初安装站点时使用的 URL并在内部使用它。这可能会在移动网站时给您带来麻烦。
第二次尝试
.htaccess
看起来也不对,因为您定义了虚拟主机而不是子文件夹中的 运行。查看更改 RewriteBase
和 RewriteRule
是否有帮助。
.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
或者看看这个 WP Doc on .htaccess
我不知道你的确切设置所以我不能建议比这更具体的东西。