vv icon indicating copy to clipboard operation
vv copied to clipboard

Multisite - subdomain redirects to vvv dashboard

Open mbootsman opened this issue 11 years ago • 7 comments

After installing a clean WordPress multisite install, I create a new website within WordPress. When visiting this site,I get redirected to the VVV dashboard.

vv create parameters:

  • foldername: test
  • domain: test.dev
  • latest WP version
  • multisite: y
  • subdomain
  • no wp-content clone
  • no local SQL file import
  • do not remove default themes/plugins
  • no sample content
  • no debug (yes I know, bad practice :) )

main VVV domain is vvv.dev test.dev works perfect. mysite.test.dev redirects to vvv.dev/dashboard/index.php

Using this dashboard: https://github.com/leogopal/VVV-Dashboard

Help is appreciated. Thanks.

mbootsman avatar Mar 24 '15 20:03 mbootsman

For subdomain multisite installations, you'll need to manually edit the config file to have each subdomain, there is no support for wildcards at this point in time.

bradp avatar Mar 24 '15 20:03 bradp

Thanks for your lightning fast reply Brad. What config file are you talking about? n00b here ;)

mbootsman avatar Mar 24 '15 20:03 mbootsman

It'll be ~/Path/to/VVV/config/nginx-config/sites/test.conf. You'll see a servername line, and you can just add your subdomain there and then re-provision.

bradp avatar Mar 24 '15 20:03 bradp

Thanks Brad. Just changed the server_name line from server_name test.dev ~^test\.\d+\.\d+\.\d+\.\d+\.xip\.io$; to server_name test.dev mysite.test.dev ~^test\.\d+\.\d+\.\d+\.\d+\.xip\.io$;

Then ran vagrant provision

And it works! How can I buy you a beer?

mbootsman avatar Mar 24 '15 20:03 mbootsman

Glad it works!

I'll have to head over to your side of the world to get that beer!

bradp avatar Mar 24 '15 20:03 bradp

:beer: useful tip! thanks again :+1:

gfargo avatar Oct 22 '15 06:10 gfargo

I encountered same issue with non-multisite website. I added following to default.conf (and created backup called default.conf-mybackup)

################################################################
# <mydomain> WordPress stable nginx configuration
#
# http://local.<mydomain>.dev - this server configuration is
# setup to listen on port 80 for any requests coming in to
# local.<mydomain>.dev and use the /srv/www/<mydomain>-com directory
# to serve them.
#
# IMPORTANT:  REPLACE THE TEXT "mydomain" WITH YOUR DOMAIN
#
server {
    listen       80;
    listen       443 ssl;
    server_name  local.mydomain.dev *.local.mydomain.dev ~^local\.mydomain\.\d+\.\d+\.\d+\.\d+\.xip\.io$;
    root         /srv/www/mydomain-com;
    include      /etc/nginx/nginx-wp-common.conf;
}

p.s. I realize default.conf isn't the ideal place to code this, but I was fed-up because I followed instructions with local-nginx-example.conf-sample to create local.mydomain.dev.conf within my /srv/www/mydomain-com/ directory, and I still encountered this issue. Note to noobs like me. I believe you also have to follow those instructions and create local.mydomain.dev.conf file (or at least it doesn't hurt to have it there too.)

ronezone avatar Dec 12 '15 02:12 ronezone