Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirects to SSO login when 404 or CodeIgniter #36

Open
AcolyteGeometry opened this issue Mar 28, 2019 · 2 comments
Open

Redirects to SSO login when 404 or CodeIgniter #36

AcolyteGeometry opened this issue Mar 28, 2019 · 2 comments

Comments

@AcolyteGeometry
Copy link

I'm trying to use CodeIgniter to write a webapp and whenever a directory isn't present in routing it redirects to SSO page when it should be routing to CodeIgniter's internal routing.

example:

load page href /site/something

Result: SSO page

expected: uri goes to php script (controller) set in routes.php via /site/index.php

@AcolyteGeometry
Copy link
Author

AcolyteGeometry commented Mar 28, 2019

I seem to have fixed it (at least for codeigniter) using rewrites at least for the index page only, but still can't seem to find a solution that works for routes to work in CodeIgniter:

`location /site {
alias /var/www/my_webapp/www/;

if ($scheme = http) {
    rewrite ^ https://$server_name$request_uri? permanent;
 }

# Default indexes and catch-all
index index.html index.php;
try_files $uri $uri/ /index.php?$args;

# removes trailing slashes (prevents SEO duplicate content issues)
if (!-d $request_filename) {
    rewrite ^/(.+)/$ /$1 permanent;
}

# removes access to "system" folder, also allows a "System.php" controller
if ($request_uri ~* ^/site/system) {
    rewrite ^/(.*)$ /site/index.php?/$1 last;
    break;
}

# unless the request is for a valid file (image, js, css, etc.), send to bo$
if (!-e $request_filename) {
    rewrite ^/(.*)$ /site/index.php?/$1 last;
    break;
}
# catch all
error_page 404 /site/index.php;

`

@tituspijean
Copy link
Member

Have you had the chance to finally fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants