How to remove public/index.php/ from url |
Hello Guys !
I ran into this problem too. My point is that I´m running my website on a SHARED HOSTING and I don´t want to mess around... I just solved this by adding a .htaccess file in root directory: Code: DirectoryIndex /public/index.php
It's very simple:
- keep the original .htaccess from the public folder - copy .htacccess and index.php from public folder to the root of your project; - edit the index.php and change the line below... $pathsPath = FCPATH . '../app/Config/Paths.php'; to... $pathsPath = FCPATH . 'app/Config/Paths.php'; That's it!
Based on your issue. I had the same problem look. I created two .htaccess file one at the public folder and the other at the root directory but no success so.
This is how I solved my own problem => I move the default .htaccess and the index.php files in the public directory to the root directory then I edit the index file to point to the app directory just like the code below PHP Code: // Location of the Paths config file. PHP Code: // Location of the Paths config file. (01-22-2018, 12:38 AM)ciadmin Wrote: https://bcit-ci.github.io/CodeIgniter4/g...x-php-fileHi, where do you set the document root? Thanks |
Welcome Guest, Not a member yet? Register Sign In |