mardi 18 octobre 2016

Proper way to setup Cname/Subdomain Laravel App that shares same Authentication

I am trying to wrap my head around using Laravel5 for this project. I want to have a

//www.example.com and //example.com site that has "MY" pages specific to me; And support *.example.com that has page templates specific to Clients

Then to further complicate, I want to allow Clients the option to have exampleCnamedDomain.com mapped to their clientXYZ.example.com site.

Normally in PHP i would setup HTACCESS to have /login route to X method; setting cookies/session specific to domain (and yes, I know we cant use example.com sessions on CNAMEd domains)

Then I would have defined logic for WWW.example.com matches; and use a different router/app; ie: myapp.php

Then for Wildcard / Cnamed sites I would then have a clientapp.php; In it, I would look up a Client ID on Init, and I could set a global var for the rest of the session, and not rely on the domain params at all.

I found a way to match subdomain routes, but cant find a way to make that work when its a CNAME. Please advise :)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire