# WebrootController not found

**URL:** https://discourse.cakephp.org/t/webrootcontroller-not-found/7683
**Category:** Need Help
**Created:** [April 20, 2020, 4:33pm UTC](https://discourse.cakephp.org/t/webrootcontroller-not-found/7683 "2020-04-20T16:33:02Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![pachacutec](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@pachacutec](https://discourse.cakephp.org/u/pachacutec)
#### Post date: [April 20, 2020, 4:33pm UTC](https://discourse.cakephp.org/t/webrootcontroller-not-found/7683/1 "2020-04-20T16:33:02Z")

</div>

Hello,

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.

---

<div class="post-metadata">

### Author: ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)
#### Post date: [April 20, 2020, 4:58pm UTC](https://discourse.cakephp.org/t/webrootcontroller-not-found/7683/2 "2020-04-20T16:58:59Z")

</div>

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

---

<div class="post-metadata">

### Author: ![pachacutec](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@pachacutec](https://discourse.cakephp.org/u/pachacutec)
#### Post date: [April 20, 2020, 5:34pm UTC](https://discourse.cakephp.org/t/webrootcontroller-not-found/7683/3 "2020-04-20T17:34:34Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![pachacutec](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@pachacutec](https://discourse.cakephp.org/u/pachacutec)
#### Post date: [April 20, 2020, 5:39pm UTC](https://discourse.cakephp.org/t/webrootcontroller-not-found/7683/4 "2020-04-20T17:39:11Z")

</div>

.htaccess in the projects home folder:

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

```

.htaccess in the webroot folder:

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

---

<div class="post-metadata">

### Author: ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)
#### Post date: [April 20, 2020, 6:13pm UTC](https://discourse.cakephp.org/t/webrootcontroller-not-found/7683/5 "2020-04-20T18:13:35Z")

</div>

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

---

<div class="post-metadata">

### Author: ![pachacutec](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@pachacutec](https://discourse.cakephp.org/u/pachacutec)
#### Post date: [April 20, 2020, 7:56pm UTC](https://discourse.cakephp.org/t/webrootcontroller-not-found/7683/6 "2020-04-20T19:56:52Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)
#### Post date: [April 20, 2020, 9:01pm UTC](https://discourse.cakephp.org/t/webrootcontroller-not-found/7683/7 "2020-04-20T21:01:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![pachacutec](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@pachacutec](https://discourse.cakephp.org/u/pachacutec)
#### Post date: [April 21, 2020, 7:32am UTC](https://discourse.cakephp.org/t/webrootcontroller-not-found/7683/8 "2020-04-21T07:32:41Z")

</div>

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

---

<div class="post-metadata">

### Author: ![anon81960487](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@anon81960487](https://discourse.cakephp.org/u/anon81960487)
#### Post date: [April 22, 2020, 9:35pm UTC](https://discourse.cakephp.org/t/webrootcontroller-not-found/7683/9 "2020-04-22T21:35:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![pachacutec](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@pachacutec](https://discourse.cakephp.org/u/pachacutec)
#### Post date: [April 23, 2020, 10:36am UTC](https://discourse.cakephp.org/t/webrootcontroller-not-found/7683/10 "2020-04-23T10:36:29Z")

</div>

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.
