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

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Support (
+--- Thread: http://localhost/index.php (/showthread.php?tid=74347)

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 [font=Tahoma, Verdana, Arial, sans-serif]http://localhost/index.php, I got an error:[/font]

[font=Tahoma, Verdana, Arial, sans-serif]Controller App\Controllers\Index.php not found, but when I run [font=Tahoma, Verdana, Arial, sans-serif]http://localhost/public/index.php I got no error[/font][/font]

[font=Tahoma, Verdana, Arial, sans-serif][font=Tahoma, Verdana, Arial, sans-serif]Please help...[/font][/font]

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';
$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