我没有使用MAMP和Xip。io用于本地安装,但我使用的是XAMPP。
我将向您解释我在计算机上启用多站点设置的想法,希望这将以正确的方式指导您使用MAMP实现。请注意,我使用的是Windows。
在做任何事情之前,我计划为我的网络设置子域,而不是子目录。因此我的计划是domain.dev, www.domain.dev, sub1.domain.dev, sub2.domain.dev ...等
因此,我不得不在hosts 归档以下条目:
127.0.0.1       domain.dev
127.0.0.1       www.domain.dev
127.0.0.1       sub1.domain.dev
127.0.0.1       sub2.domain.dev
 然后我更新了虚拟主机文件
httpd-vhosts.conf 包括以下内容:
<VirtualHost domain.dev:80>
    ServerAdmin admin@domaindev
    DocumentRoot "C:/path/to/wordpress"
    ServerName domain.dev
    ServerAlias www.domain.dev
    <Directory "C:/path/to/wordpress">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>
</VirtualHost>
<VirtualHost sub1.domain.dev:80>
    ServerAdmin admin@domain.dev
    DocumentRoot "C:/path/to/wordpress"
    ServerName sub1.domain.dev
    <Directory "C:/path/to/wordpress">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>
</VirtualHost>
<VirtualHost sub2.domain.dev:80>
    ServerAdmin admin@domain.dev
    DocumentRoot "C:/path/to/wordpress"
    ServerName sub2.domain.dev
    <Directory "C:/path/to/wordpress">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>
</VirtualHost>
 然后我,我像往常一样安装了WordPress,单次安装。
然后我启用了多站点,子域为described here 一切都很顺利。