CodeIgniter Forums
http://localhost/index.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: http://localhost/index.php (/thread-74347.html)



http://localhost/index.php - agusph - 09-13-2019

I use htaccess to change url from http://localhost/public/ to http://localhost/ but when using index.php http://localhost/index.php, I got an error:

Controller App\Controllers\Index.php not found, but when I run http://localhost/public/index.php I got no error

Please help...


RE: http://localhost/index.php - msjagan - 09-13-2019

You have to do couple of steps to remove the public text from the URL

#1 Copy "index.php" and ".htaccess" files from the public folder and the paste on the root directory (eg. http://localhost)
#2 After pasting both files to the root folder, open the index.php from the root directory and edit the following line as shown below

$pathsPath = FCPATH . '../app/Config/Paths.php';
To
$pathsPath = FCPATH . 'app/Config/Paths.php';

Try this, It will work


RE: http://localhost/index.php - agusph - 09-14-2019

It works, thnk you...


RE: http://localhost/index.php - msjagan - 09-14-2019

I am glad that it worked Smile