YunoHost-Apps / my_webapp_ynh

Custom Web app with SFTP access
GNU General Public License v3.0
49 stars 43 forks source link

Redirects to SSO login when 404 or CodeIgniter #36

Open AcolyteGeometry opened 5 years ago

AcolyteGeometry commented 5 years ago

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 commented 5 years ago

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 commented 2 years ago

Have you had the chance to finally fix it?