problem slash at the end of url |
Hello,
I'm trying this url on my project: http://localhost/ci4.0.4/about Result: works fine but when I added slash at the end of the url like: http://localhost/ci4.0.4/about/ Result: it redirect to http://localhost/about This is my setup: $baseURL = 'http://localhost/ci4.0.4/'; I'm using: wamp server under Windows10 any advice, Thanks in Advance,
Can you change the folder name from ci4.0.4 to something else without the dots ?
(12-11-2020, 11:05 AM)sammyskills Wrote: Okay. Sure, By the way, I moved the index.php and htaccess from public folder to the root This is my htaccess and Routes files (I attached my htaccess) My Routes: /** * Auth routes */ $routes->match(['get', 'post'], 'login', 'Auth\LoginController', ['filter' => 'noauth']); $routes->match(['get', 'post'], 'password/forgot', 'Auth\PasswordController::forgot', ['filter' => 'noauth']); $routes->match(['get', 'post'], 'register', 'Auth\RegisterController', ['filter' => 'noauth']); $routes->get('logout', 'Auth\LogoutController::index'); /** * App routes */ $routes->get('/', 'HomeController::index', ['filter' => 'auth']); $routes->get('/home', 'HomeController::index', ['filter' => 'auth']); $routes->get('/about', 'AboutController::index', ['filter' => 'auth']);
Quote:By the way, I moved the index.php and htaccess from public folder to the root Just to confirm... Have you updated the default $pathsPath = realpath(FCPATH . '../app/Config/Paths.php'); to match the current directory structure? (12-11-2020, 11:36 AM)sammyskills Wrote:Quote:By the way, I moved the index.php and htaccess from public folder to the root Yes, I did otherwise it will not work This is my pathsPath: $pathsPath = realpath(FCPATH . 'app/Config/Paths.php');
Okay.
I think the problem you're facing is related to the location of the index.php and .htaccess. From the docs, those files should be in your public folder. I can't really say what you want to achieve by having those files outside of the public folder, maybe you can shed some light so I can understand better. (12-11-2020, 11:48 AM)sammyskills Wrote: Okay. Thank you for you reply, I put the files outside of public because my goal is to host the application in a shared hosting, so I want to remove public folder from my url, and this is what most people suggest to do if you want to host the app in a shared hosting I just tried it using the public folder and it has the same behavior!!
You need to edit the Paths.php file and give it the correct path to system and app folders.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |