# Strange routing issue

**URL:** <https://discourse.cakephp.org/t/strange-routing-issue/10012>\
**Category:** Need Help\
**Created:** [December 20, 2021, 12:50pm UTC](https://discourse.cakephp.org/t/strange-routing-issue/10012 "2021-12-20T12:50:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elbert](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@elbert](https://discourse.cakephp.org/u/elbert)\
**Post date:** [December 20, 2021, 12:50pm UTC](https://discourse.cakephp.org/t/strange-routing-issue/10012/1 "2021-12-20T12:50:55Z")

</div>

Hi All,

Since yesterdaymoring I have a very strange problem and I don’t know how to debug it. I hope someone can point me in the right direction.

I have a site up and running (and live, therefore difficult to debug). I develop this site on localhost and on localhost I do not have any issues.  
The problem occurs since yesterday-moring, but: I did not change anything on my server the last week.  
The only thing I can imagine, is some server/WHM/Appache update that causes this (but on the other hand that seems unlikely if you see the problem, which look like a routing issue).

Here we go:  
It is a commercial site with a cart. I Therefore have a CartsController with (amongst other) the action addtocart(). This has worked perfectly for ages.  
Since yesterday, ALL the URL’s I build and that point to my CartsController, are re-routed to ‘account’.

So This  
`<?=$this->Url->build(['plugin' => false, 'prefix' => false, 'controller' => 'Carts', 'action' => 'addtocart']); ?>`  
Results in this:  
`https://mysite.com/account/addtocart/3`  
(instead of “[https://mysite.com/carts/addtocart/3](https://mysite.com/carts/addtocart/3)” as it has always done.

So: that looks to me like a standard CakePHP routing setting like :  
`$routes->connect('/account/addtocart', ['controller' => 'Carts', 'action' => 'addtocart']]);` (or something to that effect)  
But: I checked my whole code (and of course espacially routes.php, but also plugins, etc) and can not find any route that matches this.

And the strangest thing (to me) is that I did not change any code on my server last week, so I can not understand how/why this happens.

Does anyone have any ideas? Can I check this somehow in logs? But how? Where? (on a live server, not on localhost) What would you do?  
Any help is appriciated.

(I use CakePHP 3.10.2)

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [December 20, 2021, 3:53pm UTC](https://discourse.cakephp.org/t/strange-routing-issue/10012/2 "2021-12-20T15:53:32Z")

</div>

Do you have routes cache enabled in your RoutingMiddleware?

> <https://github.com/cakephp/app/blob/4.x/src/Application.php#L92>

If so, maybe there is a problem with that since the default duration of the routes cache is 1 year.

> <https://github.com/cakephp/app/blob/4.x/config/app.php#L145>

Have you tried `bin/cake cache clear_all` on your live server?
