There are 3 ways to define hosts
- The main
The recommended way is to use the
vvv-hosts is supported for backwards compatibility, and
vvv-init.sh can be used for edge circumstances.
When changing hosts, the Nginx config will need updating so that Nginx knows to listen for requests on those domains. If this isn’t done, the VVV dashboard will appear instead of the desired site.
Don't forget to Reprovision on ChangesIf you modify
vvv-custom.yml, you must reprovision for the changes to take effect. Run
vagrant reloadafter making changes.
When adding a site in
vvv-custom.yml, add a hosts section listing the domains of that site. For example:
example: hosts: - example.com
This will map example.com to the example site, and update the HOST file on your machine.
VVV 1 added hosts using a file named
vvv-hosts, and VVV 2 continues support for this for backwards compatibility reasons. Place this as a text file with no file extension in a
provision subfolder, or in the root of the site.
Here’s an example that adds 2 domains: