So, I made a clean install of Grav core + Admin plugin into my http://localhost/test/ which is working and showing the default page.
I copied the content of setup_subdirectory.php from the docs into setup.php i my root folder “test”.
I then created test/user/sites/subsite/user/ and in there placed config, pages, plugins, themes that I copied from the base user-dir.
Could someone point me in the right direction?
I’ve read all the docs about this and all forum posts that I could find about Multisite and still can’t find a solution to this.
Yes, I’m using https://laragon.org/ to run my local server and I have the .htaccess in the Grav root folder. I haven’t changed anything from the default settings.
I did a quick test, it seems that the setup.php picks /test as your subsite. You need to run it in your root domain (e.g. localhost/subsite). You can check this by adding an
echo ROOT_DIR . "user/{$folder}"; exit();
inside the
if (!$name || !is_dir(ROOT_DIR . "user/{$folder}")) {
check.
You’ll see it’s returning /your-path-htdocs/user/sites/test and not /your-path-htdocs/test/user/sites/subsite.
You can change your setup, or tweak how the folder is calculated in the setup.php file.
Thank you for pointing in the right direction. It got me halfway there, I think.
I replaced $name = Folder::shift($path);with $name = basename($path);and that made it fetch the subsite instead of test and displayed the home page for subsite.
The remaining issue for me now is that if I create another normal page in my pages-folder under subsite it is not found when I point to localhost/test/subsite/another-page-for-subsite