# Href for route with multiple parameters

**URL:** <https://discourse.aurelia.io/t/href-for-route-with-multiple-parameters/3514>\
**Category:** Help Requests\
**Created:** [May 26, 2020, 12:01pm UTC](https://discourse.aurelia.io/t/href-for-route-with-multiple-parameters/3514 "2020-05-26T12:01:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![roddharris](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/roddharris/32/1340_2.png) [@roddharris](https://discourse.aurelia.io/u/roddharris)\
**Post date:** [May 26, 2020, 12:01pm UTC](https://discourse.aurelia.io/t/href-for-route-with-multiple-parameters/3514/1 "2020-05-26T12:01:25Z")

</div>

I have some routes like so:

```auto
{
   route: "/sessions/:sid?",
   nav: true,
   name: "sessions",
   moduleId: ...,
   href: "/sessions"
},
{
   route: "/sessions/:sid/jurors",
   nav: false,
   name: "sessionjurors",
   moduleId: ...
},
{
   route: "/sessions/:sid/cases/:cid?",
   nav: false,
   name: "cases",
   moduleId: ...
}

```

Notice the last route – “cases”. My understanding is that because I have an optional parameter, I’m also required to provide an `href` value (like I did with “sessions”). However, the “base” href value requires a session id (`sid`).

Is there a way to configure this or get this working with Aurelia routing?

**Note**  
Incidentally, I tried doing the following:

```auto
...
{ 
   route: "/sessions/:sid/cases/:cid?",
   name: "cases",
   nav: false,
   moduleId: ...,
   href: "/sessions"
},
{
   route: "/sessions/:sid/cases/:cid/jurors",
   name: "casejurors",
   nav: false,
   moduleId: ...
}

```

Notice the base href set to “sessions”. This satisfied the need for the href, but it failed when trying to navigate from `casejurors` back to `cases`. The navigation acted really weird. The first click of the back arrow left me sitting at `casejurors`. The second click of the back arrow took me all the way back to `sessions` instead of to `cases`.

---

<div class="post-metadata">

**Author:** ![jwx](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/jwx/32/507_2.png) [@jwx](https://discourse.aurelia.io/u/jwx)\
**Post date:** [May 26, 2020, 5:34pm UTC](https://discourse.aurelia.io/t/href-for-route-with-multiple-parameters/3514/2 "2020-05-26T17:34:21Z")

</div>

I don’t think I can help, but I’d like to understand the use cases here. If we look at it from a module/component perspective, is it  
1a) sessions, AND  
1b) session(sid)  
,  
2) session(sid)/jurors [as in two components in parent-child viewports]  
OR  
2) session-jurors(sid) [one component]  
,  
3a) session(sid)/cases, AND  
3b) session(sid)/case(cid) [two components, parent-child viewports]  
OR  
3a) session-cases(sid), AND  
3b) session-case(sid, cid) [one component]  
?
