# Custom routing CakePHP 3

**URL:** <https://discourse.cakephp.org/t/custom-routing-cakephp-3/3472>\
**Category:** Need Help\
**Created:** [November 9, 2017, 3:53pm UTC](https://discourse.cakephp.org/t/custom-routing-cakephp-3/3472 "2017-11-09T15:53:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cellydy](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@cellydy](https://discourse.cakephp.org/u/cellydy)\
**Post date:** [November 9, 2017, 3:53pm UTC](https://discourse.cakephp.org/t/custom-routing-cakephp-3/3472/1 "2017-11-09T15:53:54Z")

</div>

I’m trying to create SEO friendly routing. I have a website with hotels and hotel rooms. I want to create a route progression that routes to different controllers/actions.

I want my urls to look like `www.hotelwebsite.com/language/hotel-name/room-name`

Here are the three routes I need:

If the url has a language parameter + 2 parameters:

```
$routes->connect('/:language/:hotelname/:room/', ['controller' => 'rooms', 'action' => 'viewRoom']); 

```

where

```
public function viewRoom($hotel_slug, $room_slug)

```

in which

```
:hotelname == $hotel_slug and :room == $room_slug

```

* * *

If the url has a language parameter + 1 parameter:

```
$routes->connect('/:language/:hotelname/', ['controller' => 'hotels', 'action' => 'viewHotel']);

```

where

```
public function viewHotel($hotel_slug)

```

in which

```
:hotelname == $hotel_slug

```

* * *

Otherwise use my standard route

```
$routes->connect('/:language/:controller/:action/*');

```

Is this even remotely possible?
