![]() |
Foreign App in Subfolder / SSO Solution - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Foreign App in Subfolder / SSO Solution (/showthread.php?tid=71446) |
Foreign App in Subfolder / SSO Solution - tom_k - 08-15-2018 I am fairly new to it, but learning and using CI 3.1.9 in a LAMP test environment and making some progress with MVC and the such. Great framework to say the least! Two questions arise while concepting my solution:
RE: Foreign App in Subfolder / SSO Solution - jreklund - 08-15-2018 1. Yes, you need to setup a .htaccess file inside /subdir/ or in your Apache configuration. That /subdir/.htaccess file will overwrite your root /.htaccess 2. Your /subdir/ app will need to query your root / app. If that person aren't logged in redirect to / and login and back again /subdir/. Can't give you any examples as it's application depended. One /subdir/ application I used could access the same $_SESSION variable and see if the user was logged in, and then do an internal login for that application. PHP Code: <?php Here's how you write an auth plugin for DOKUWIKI: https://www.dokuwiki.org/devel:auth_plugins RE: Foreign App in Subfolder / SSO Solution - Pertti - 08-15-2018 Just jumping on basically already answered question - .htaccess is not necessary by itself to make it work. Usually the root .htaccess for CI is set up in a way that it leaves actually existing files alone, and only tries to re-route URL to CodeIgniter index.php file if it can't find actual file for it. So if you use something that goes directly to .php files, that would work just by putting files in the subfolder. Of course, if the additional app is using it's own URL rewrite rules, it'll also work, if .htaccess is placed within that apps subfolder. RE: Foreign App in Subfolder / SSO Solution - tom_k - 08-17-2018 Thank you very much. This is of great help -- will give it a try soon. |