CodeIgniter Forums
Redirect Trailing Slashes...Problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: Redirect Trailing Slashes...Problem (/showthread.php?tid=74480)



Redirect Trailing Slashes...Problem - kingstyles - 09-30-2019

I have 2 problems:

When i call the following URL with a trailing slashe (news is Controller):
http://localhost/ci4/public/news/

It removes the 'root' and 'public' and redirects to :
http://localhost/news

is it a problem or i'm wrong?

And another problem is: in the public/.htaccess and in the Redirect Trailing Slashes section, it does not check if the requested resource is Dir or not
Code:
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

should we put following line before above?

Code:
RewriteCond %{REQUEST_FILENAME} !-d



RE: Redirect Trailing Slashes...Problem - sammyskills - 12-12-2020

You can see this StackOverflow answer.