WebrootController not found


we have been running a CakePHP based application with our web provider for 6 years. Last year we upgraded it to Cakephp version 3.7.8 (without problems). Since four weeks it does not work anymore, without any changes on our part. The error message says: ‘Error: The requested address ‘/webroot/’ was not found on this server.’.

We downloaded a current version of Cakephp and installed it in another subdomain without any changes. Again, the error message “WebrootController not found” appears instead of the Cakephp start page.

My guess is that the rewriting through the .htaccess files doesn’t work anymore for some reason. The web provider of course claims that it is up to us. (The application has been successfully tested on two private servers and on test accounts on two other hosters).

Can anyone help me to solve this problem? We would like to stay with this web provider.

Thanks for your help and your ideas.

If you think it’s a problem with .htaccess, perhaps showing us what you have would be helpful.

I use the original .htaccess files. As described above I have tested an unmodified Cakephp installation.

Maybe my assumption is wrong. My understanding is that CakePhp uses the RewriteRules to redirect the requests either to the appropriate controllers or to the static content in the webroot folder. And this doesn’t seem to work anymore.

.htaccess in the projects home folder:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^(\.well-known/.*)$ $1 [L]
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]

.htaccess in the webroot folder:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

And what folder does your Apache configuration say is the document root for this site? It should be the webroot folder.

I have no access to the Apache configuration at my webspace provider. My subdomain is redirected to a folder /myproject. There is the CakePHP package, which contains the folder webroot. But this is the standard structure of a CakePHP project.

And this is how it’s always been set up on this server, and nobody’s changed anything, and it suddenly stopped working?

Yes, so is it.
The hotline of the webspace provider says that nothing has been changed and it would be our fault.

You have to make sure that your domain is being pointed at /project/webroot, not /project since that will cause issues.

Thanks a lot! Now it works again. Since it has worked for over five years with the other document root, I would never have thought to look for the problem there.