File not found on my online server |
Hi, I've been trying to solve my problem all day but I haven't been able to solve it. Locally, my site works fine when I browse it. But on my online server, when I try to access the mywebsite.com/test page it gives me this error: File not found.
Routes.php PHP Code: <?php Home.php PHP Code: <?php All my files (app, public, tests, vendor, writable, etc.) are in the root of my server in the ‘www’ folder. Thank you in advance for your help.
Do you use nginx?
It seems your have something wrong with your web server configuration.
See https://codeigniter4.github.io/CodeIgnit...g-services
But if your hosting service provides nginx, the user guide may not help you.
I did as explained in this guide (first (and best) solution), I have a folder at the root of my server under the name www, which contains all the project files. And I've changed the root folder in the server settings so that it points directly to the public folder. I can try the other solutions suggested, but I don't understand why the first solution doesn't work.
I've just tried the other two solutions (with two directories, and using .htaccess) and the site still works, but the epas37.com/test route still doesn't work.
You may need to change app/Config/App.php
PHP Code: /** Also your server maybe case sensitive so you would need to use all lower case file names. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
The default value was already REQUEST_URI. I also tried as advised to leave my file names in lower case (Home.php -> home.php) and by modifying my Routes.php file (Home::mytest -> home::mytest), the site is still operational but still returns the ‘File not found’ error when I try to access the epas37.com/test route.
What is your web server software?
(05-10-2024, 11:57 PM)Kobbs Wrote: I also tried as advised to leave my file names in lower case (Home.php -> home.php) and by modifying my Routes.php file (Home::mytest -> home::mytest), The change is wrong. You should not do like that. You must name the file in the exact same case as the class name. Because filenames in most servers are case sensitive. E.g., 1. if the classname is Home, then the file name must be Home.php 2. if the classname is home, then the file name must be home.php. (05-11-2024, 01:11 AM)kenjis Wrote:(05-10-2024, 11:57 PM)Kobbs Wrote: I also tried as advised to leave my file names in lower case (Home.php -> home.php) and by modifying my Routes.php file (Home::mytest -> home::mytest), Basically, my Home.php file contains the Home class (in upper case). When I modified it, I forgot to change the case, but unfortunately the problem remains the same. If you want, I can put my project on github? |
Welcome Guest, Not a member yet? Register Sign In |