我不知道您使用的是什么系统,但在 Windows 上,我在端口 80 上运行 IIS,在端口 8080 上运行 Apache,现在最后一部分有多个 wordpress 单站点和多站点(网络安装)。下面的代码有效
-
#truncated hosts file at c:/windows/system32/drivers/etc/hosts
127.0.0.1 localhost
#must match the
127.0.0.1 sx.localhost twt.localhost upse.localhost veet.localhost brbox.localhost eunoia.localhost
127.0.0.1 wp.dev
-
以下所有内容都是 D:\xampp\apache\conf\extra\httpd-vhosts 的一部分
NameVirtualHost *:8080
<VirtualHost *:8080>
DocumentRoot "D:/xampp/htdocs"
ServerName localhost
</VirtualHost>
/这是一个正常工作的 wordpress 普通 wordpress 博客。abce.localhost 必须与上面的hosts文件匹配,只是不断添加它们,但子域多站点(网络必须始终在最后)
<VirtualHost *:8080>
DocumentRoot "D:/xampp/htdocs/ki/abce/wordpress"
ServerName abce.localhost
<Directory "D:/xampp/htdocs/ki/abce/wordpress">
Options Indexes FollowSymLinks ExecCGI Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
/下面是如果不是 8080 问题,网络子域博客将如何工作
<VirtualHost *:8080>
DocumentRoot "D:/xampp/htdocs/alllive/wordpress"
ServerAlias *.wp.dev
ServerName wp.dev
<Directory "D:/xampp/htdocs/alllive/wordpress">
Options Indexes FollowSymLinks ExecCGI Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
-