我使用多站点+路径(与子域相反)安装了Wordpress
除了没有加载JS/CSS文件外,似乎可以正常工作。我的配置:
<Directory "/var/www/pages">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
我的htaccess
RewriteEngine On
RewriteBase /pages/
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).*) home/itaymoav/dev/lmspages/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\\.php)$ home/itaymoav/dev/lmspages/$2 [L]
RewriteRule . index.php [L]
我遵循了worpress中的所有步骤。关于如何创建多站点的org教程。以下是配置文件条目:
/* Multisite */
define(\'WP_ALLOW_MULTISITE\', true);
define(\'MULTISITE\', true);
define(\'SUBDOMAIN_INSTALL\', false);
define(\'DOMAIN_CURRENT_SITE\', \'localhost\');
define(\'PATH_CURRENT_SITE\', \'/pages/\');
define(\'SITE_ID_CURRENT_SITE\', 1);
define(\'BLOG_ID_CURRENT_SITE\', 1);
我错过了什么?
SO网友:Itay Moav -Malimovka
问题在于。htaccess文件生成的安装脚本。具体来说,这两条线:
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) home/itaymoav/dev/lmspages/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\\.php)$ home/itaymoav/dev/lmspages/$2 [L]
其中的路径是文件的实际路径。而它必须是worpress安装的根目录的相对路径。或者,简单地说:
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\\.php)$ $2 [L]
有趣的