I've been digging on Grav the last month! I've slogged through many issues on my own and the documentation is fantastic, but I've run into something that has me stumped.
I've got my sites running on multisite through a series of folders at the same level as the user folder:
-user
-user-www.site1.com
-user-www.site2.com
This part works great - no problems there!
I have several other sites that need to get built - sometimes before the DNS entries are made. In order to show them to internal and external stakeholders, I wanted to allow subdirectory multisite as well. Something like this:
www.existingdomain.com/www.site3.com
And I wanted to use the exact same install directory.
Crazy? Maybe.
So, I got subdirectory multisite working in setup.php. I'm setting a cookie if there's a query string like this:
www.existingdomain.com/www.site3.com?preview=true
Works great in my localhost (apache)! Yay! And it appeared to work perfectly in production (Nginx)! However, here's what happens:
- Go here: www.existingdomain.com/www.site3.com?preview=true and the page shows up
- Refresh the page and I get these errors in my grav log:
grav.CRITICAL: Undefined index: /var/www/html/grav/user-www.site3.com/pages - Trace:
0 /var/www/html/grav/system/src/Grav/Common/Page/Pages.php(340): Whoops\Run->handleError(8, 'Undefined index...', '/var/www/html/m...', 340, Array)
1 /var/www/html/grav/system/src/Grav/Common/Twig/Twig.php(305): Grav\Common\Page\Pages->root()
2 /var/www/html/grav/system/src/Grav/Common/Grav.php(157): Grav\Common\Twig\Twig->processSite(NULL)
3 /var/www/html/grav/vendor/pimple/pimple/src/Pimple/Container.php(113): Grav\Common\Grav::Grav\Common{closure}(Object(Grav\Common\Grav))
4 /var/www/html/grav/system/src/Grav/Common/Grav.php(257): Pimple\Container->offsetGet('output')
5 /var/www/html/grav/index.php(37): Grav\Common\Grav->process() #6 {main} [] []
This last bit of set up is so tantalizingly close, but I've reached the end of my ability to troubleshoot this - what am I doing wrong?