# Trying to change url link using routing with parameters not showing controller or action

**URL:** <https://discourse.cakephp.org/t/trying-to-change-url-link-using-routing-with-parameters-not-showing-controller-or-action/3696>\
**Category:** Need Help\
**Created:** [December 27, 2017, 4:56pm UTC](https://discourse.cakephp.org/t/trying-to-change-url-link-using-routing-with-parameters-not-showing-controller-or-action/3696 "2017-12-27T16:56:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![damo101](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@damo101](https://discourse.cakephp.org/u/damo101)\
**Post date:** [December 27, 2017, 4:56pm UTC](https://discourse.cakephp.org/t/trying-to-change-url-link-using-routing-with-parameters-not-showing-controller-or-action/3696/1 "2017-12-27T16:56:29Z")

</div>

I’m trying to replace my url link with parameters passed using a link but I still want to controller and action to do their job.

What I want to do is change the url from **[http://localhost:8084/cakephp/posts/specific-post/132/damian\_fenech/asdfad](http://localhost:8084/cakephp/posts/specific-post/132/damian_fenech/asdfad)** to **[http://localhost:8084/cakephp/posts/damian\_fenech/asdfad](http://localhost:8084/cakephp/posts/damian_fenech/asdfad)**.  
Can anyone help me please?

**Router:**

```
Router::scope('', function (RouteBuilder $routes) {
        $routes->connect('/:id/:slug/:slug2',
            ['controller' => 'posts', 'action' => 'specificPost']
        )->setPass(['id']);
        $routes->fallbacks(DashedRoute::class);
});

```

Controller Action:  
public function specificPost($id = null) {  
$posts = TableRegistry::get(‘posts’);  
$post = $posts-\>find(‘all’)-\>where([‘post\_Id’ =\> $id])-\>contain(‘Users’)-\>contain(‘Comments’);  
$all\_posts = $post-\>toArray();  
$this-\>set(“posts”, $all\_posts);  
}

Posts/index.ctp:  
`echo '<div class="col-sm">'.$this->html->link($post['post_Id'], ['controller' => 'posts', 'action' => 'specificPost',$post->post_Id, $post->user['first_name'].'_'.$post->user['last_name'], Inflector::slug($post['post_content'])]).'</div>';`
