Sitelok for use on subdomain from parent domain install

Hi Forum,

Anyone know if it’s possible to integrate login to sitelok across multiple subdomains with a sitlok install on only the parent domain? I tried this example code below, where my sitelok install is in the slpw subdirectory of my main domain:

slpw installation path:
correlating host file path: /home/RootUser/public_html/slpw/

subdomain example page:

top of page code:

<?php $groupswithaccess="ALL"; require_once("/home/RootUser/public_html/slpw/sitelokpw.php"); ?>

Now when I run this on I get the desired login dialog, but it still references images and the captcha as relatively linked under the subdomain, so I get these errors:

file not found:

Now in the default login form for Sitelok, these links are dynamically built from $SitelokLocationURLPath variable. Anyone with sufficient SL expertise to point me where I might set this or ideas for a better work around?

Tagging @vibralogix

Thanks @teefers

Messing with this one a bit more, can’t find any good way to pass authentication into a subdomain. It isn’t a deal breaker if users need to authenticate again when hitting the sub, but I’d like to share the same user backend (same user setup and passwords without duplicate management). If I hard code into hrefs or file paths, replacing $SitelokLocationURLPath with a file path, I can get some forms to load better, but I can’t get everything to work right, and in particular the php header script seems to fail this way. I’ve tried symbolically linking into slpw of the main domain, but that’s failing too.

@bolesjb As I recall you need to have a separate Sitelok install for each subdomain. That’s the bad news … but if you organize things so that various websites are subfolders in the main domain then 1 Sitelok install will work. I have both subdomains and subfolders. But for all the sites where I need membership control I add them on as subfolders. This may, or may not, be a big deal for you. I create course websites so having a subfolder structure like this is not a problem:

But if you truly need subdomains (like this) then you’ll need separate installs:

1 Like

@Mathew thanks - that’s certainly my preference, but with some of our micro services style products (lambda, twilio, etc.) there are so many developers cranking single page web apps without coding for a subdirectory structure it’s becoming painful. I have taken a stab at symbolically linking, etc. but it looks like there’s no good approach to handing off to a subdomain post authentication. I’ve thought about whether I could drop it on a subdomain with restricted access, and then whether there’s some referenced object that I could wrap with authentication, or some such other nonsense but haven’t come us with anything less than ridiculously silly so far.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.