# Bad URL redirection

**URL:** <https://discourse.cakephp.org/t/bad-url-redirection/3731>\
**Category:** Need Help\
**Created:** [January 5, 2018, 1:24pm UTC](https://discourse.cakephp.org/t/bad-url-redirection/3731 "2018-01-05T13:24:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Toto631](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@Toto631](https://discourse.cakephp.org/u/Toto631)\
**Post date:** [January 5, 2018, 1:24pm UTC](https://discourse.cakephp.org/t/bad-url-redirection/3731/1 "2018-01-05T13:24:53Z")

</div>

Hello !

I start on CakePHP and I get a project from someone from my company and I have to make a simple link to a site other than CakePHP.  
This page is: calendrier.php located in …/calendrier/calendrier.php (relative path in relation to cakePHP)

I just edited a few lines in the account.ctp file to add:

And it works when the URL is: [www.site.com/intranet](http://www.site.com/intranet)  
But no longer works when the URL is of type: [www.site.com/intranet/account](http://www.site.com/intranet/account)  
And I have a type error: “Create the class CalendarController below in file: src \ Controller \ Account \ CalendarController.php” but the problem is that even if I create it I still have additional errors.

My question is: can I do a simple redirection without going through X files and configurations?  
If not, how to do this redirection properly?

Thank you in advance ! 🙂

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [January 9, 2018, 5:45pm UTC](https://discourse.cakephp.org/t/bad-url-redirection/3731/2 "2018-01-09T17:45:40Z")

</div>

I am not sure what is your problem, but this may help you: [https://book.cakephp.org/3.0/en/development/routing.html#prefix-routing](https://book.cakephp.org/3.0/en/development/routing.html#prefix-routing)
