# Authentication and root folder mismatch after subfolder implementation

**URL:** <https://discourse.cakephp.org/t/authentication-and-root-folder-mismatch-after-subfolder-implementation/7930>\
**Category:** Performance\
**Created:** [June 11, 2020, 9:44am UTC](https://discourse.cakephp.org/t/authentication-and-root-folder-mismatch-after-subfolder-implementation/7930 "2020-06-11T09:44:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HypJ3U50N](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/hypj3u50n/32/1803_2.png) [@HypJ3U50N](https://discourse.cakephp.org/u/HypJ3U50N)\
**Post date:** [June 11, 2020, 9:44am UTC](https://discourse.cakephp.org/t/authentication-and-root-folder-mismatch-after-subfolder-implementation/7930/1 "2020-06-11T09:44:02Z")

</div>

I have worked with an working app locally, but after putting it online I see a relation between the authentication plugin and encountered errors. The application is stored in a subfolder of a webpage e.g. www.X.y/cakephpapp/.

Going to tables indexes correctly routes to /cakephpapp/tablename, but the authentication check redirects to /users/login, which returns in 404. Moreover, while loggin in @ /cakephpapp/users/login, debugging the authenticator result gives the following error:

```auto
[protected] _errors => [
		(int) 0 => 'Login URL `https://X.y/cakephpapp/users/login` did not match `/users/login`.'
	]

```

So again this seems to be a URL problem. I can (hopefully) fix this by going through all the plugin code in vendor folders, but is this supposed to be non-adaptive by default ?

I tried without success, by adjusting in config/app/php:

‘paths’ =\> [  
‘plugins’ =\> [ROOT . DS . ‘cakephpapp’ . DS . ‘plugins’ . DS,]

---

<div class="post-metadata">

**Author:** ![HypJ3U50N](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/hypj3u50n/32/1803_2.png) [@HypJ3U50N](https://discourse.cakephp.org/u/HypJ3U50N)\
**Post date:** [June 12, 2020, 11:16am UTC](https://discourse.cakephp.org/t/authentication-and-root-folder-mismatch-after-subfolder-implementation/7930/2 "2020-06-12T11:16:51Z")

</div>

This has been issued @ github already…

> <https://github.com/cakephp/authentication/issues/352>
>
> I have a new installation of CakePHP 4 in localhost/v3. I created a prefix route for "admin" and added the authentication...
