(Error 404)-Route controller not recognized on server

Hi, i’m new to the development world. I just migrated a project from my computer(Windows local) to the server on cloud (VM Línux). I’m using a simple MVC based architecture. The question is:

1 - I did all necessery configiratios on httpd.conf file as:

   DocumentRoot "/MyProject/public"
   <Directory "/MyProject/public">
      AllowOverride all
      Require all granted

-#I uncommented the lines belowon.

  Include etc/extra/httpd-vhosts.conf
  Include etc/extra/httpd-xampp.conf

2- In the httpd-vhosts.conf file i have:

  <VirtualHost *:80>
     DocumentRoot "/MyProject/public"
     ServerName ""
     ErrorLog "logs/"
     CustomLog "logs/" common

3- In my hosts file i added:

I’m not using any .htaccess file for application and if I should use it, I have no idea how to configure it. The project works fine on my local server (my computer), I’m using Xampp in both scenarios(Local and VM).

I just have an index.php file in the public directory with the following code:

$route = new \App\Route;

Any ideas on how to resolve this? Please! Thanks!

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
February 25, 2022


Do you get any specific errors when visiting your website via your browser or is it just the 404 error?

Also, are your project files available in the /MyProject/public directory on your server? You could check this with the ls -la command:

ls -la /MyProject/public

Usually, what I do myself whenever I’m having issues with my webserver is to check the error logs. For Apache, the default location of the error log should be at:

cat /var/log/apache2/error.log