我创建了一个包含主要wp站点的子域。 wp.domain.com
我在WP中创建了2个网站: 1. wp.domain.com 2. wp2.domain.com
" wp2.domain.com"必须映射到domain2.com/blog
Domain2.com指向我的服务器 我在下面有虚拟主机条目:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName domain2.com
ServerAlias www.domain2.com
DocumentRoot /var/www/domain2.com/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
域已成功添加到WP 网站ID:2 域名:domain2.com/blog
当我访问&#34; domain2.com/blog"没有任何反应。
我错过了什么?
答案 0 :(得分:0)
服务器名称应该是子域,如:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName sub.domain2.com
DocumentRoot /var/www/domain2.com/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined