WatsMyName
WatsMyName

Reputation: 4478

Silverstripe subsite redirect loops

I have installed subsite module in my Silverstripe project. I have two domains

  1. login.abc.com =>A main site
  2. login.xyz.com => A subsite, virtual host is created

The problem here is I can access -

  1. login.abc.com/ and login.abc.com/admin
  2. login.xyz.com/admin

But I can't access login.xyz.com, it causes redirect loops

I then tried to debug this issue on framework\main.php

DataModel::set_inst(new DataModel());
echo "This code is printed"; //This code executes
Director::direct($url, DataModel::inst());

I m stuck for hours to figure out what might be causing the redirect loops, but in vain. Any help will be highly appreciated.

UPDATE

I created another domain login.pqr.com [Not subsite] and pointed to same folder and this also works properly. So the problem is clear that the issue exist only in subsite domain.

UPDATE 2

I then created subsite with domain with same name login.pqr.com. Now this time website frontend login.pqr.com didn't work.

UPDATE 3 If from subsites menu under admin, I turn off Enable public access, then it works.

So it seems issue in subsite module?? Any suggestions?

Upvotes: 0

Views: 332

Answers (1)

WatsMyName
WatsMyName

Reputation: 4478

For those who might stumble upon this post in the future, to fix this issue -

  1. We need to make sure that sub sites have pages created, most importantly the landing page
  2. We can copy pages from the main site to the sub sites. Subsite module seem to have bug - If the page you are copying has children, the children are not copied, even if there is option to copy children

Upvotes: 1

Related Questions