Welcome! Log In Create A New Profile

Advanced

How to remove trailing slashes for codeigniter?

Phillip Oldham
July 31, 2009 10:46AM
I'm having trouble dropping the trailing slashes to fix issues with
codeigniter. My setup is as follows:

location / {
try_files $uri @codeigniter;
}
location @codeigniter {
rewrite ^ /index.php$uri last;
}


I've tried the following modification:

location @codeigniter {
rewrite ^/(.*)/$ /$1 permanent;
rewrite ^ /index.php$uri last;
}

but this only works when the url is:
mysite.org/mypath/ --> mysite.org/mypath

However, if you access the same path the "long" way
(mysite.org/index.php/mypath/) the rewrite doesn't get picked up.

Can someone spare a few minutes to explain to me why this is?
Subject Author Posted

How to remove trailing slashes for codeigniter?

Phillip Oldham July 31, 2009 10:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 252
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready