<p><strong>Edit</strong> - looks like it's the specific use of <code>token</code> as a parameter that's causing the problem.</p>

<hr>

<p>The route doesn't need to account for the get parameters, so it only needs to be <code>micros-test/guest-reset-password</code>.</p>

<p>You then fetch the parameter using <code>craft.request.getParam('token')</code>.</p>

CC BY-SA 3.0
2015-04-16T21:55:42.140Z
The problem I have is that when the token is there, the route doesn't resolve and so results in a 404.
Russ Back
CC BY-SA 3.0
2015-04-17T13:21:35.983Z
Sorry you're correct, using `token` does indeed cause a 404 on an otherwise working route. Must be used by the system for something, can't say I've seen it documented though.
Adam Gilleard
CC BY-SA 3.0
2015-04-17T16:03:55.743Z
You can adjust it with the [tokenParam](http://buildwithcraft.com/docs/config-settings#tokenParam) config setting.
Brad Bell
CC BY-SA 3.0
2015-04-16T21:53:25.347Z
2015-04-17T13:22:58.770Z
2015-04-17T13:22:58.770Z
Adam Gilleard
<p>In my routes file I have this:</p>

<pre><code>'micros-test/guest-booking/(?P&lt;bookingId&gt;[a-z0-9-]*)' =&gt; 'micros-test/guest-booking',
</code></pre>

<p>Which works fine for URLS like this:</p>

<blockquote>
  <p>/en/micros-test/guest-booking/some-valid-alphanumeric-id</p>
</blockquote>

<p>However I need to add another that I can't get working, this time with a querystring value, such as this:</p>

<blockquote>
  <p>/en/micros-test/guest-reset-password?token=some-valid-alphanumeric-id</p>
</blockquote>

<p>How can I get that to route to my endpoint and pass on the token parameter?</p>

<p>I've tried this but to no avail:</p>

<pre><code>'micros-test/guest-reset-password/?token=(?P&lt;token&gt;[a-z0-9-]*)' =&gt; 'micros-test/guest-reset-password',
</code></pre>

<p>What have I got wrong there?</p>

<routing>
How can I reroute this querystring URL?
# How can I reroute this querystring URL?

(Asked by: username_0 on 2015-04-16)

In my routes file I have this:
'micros-test/guest-booking/(?P[a-z0-9-]*)' => 'micros-test/guest-booking',

Which works fine for URLS like this:

/en/micros-test/guest-booking/some-valid-alphanumeric-id

However I need to add another that I can't get working, this time with a querystring value, such as this:

/en/micros-test/guest-reset-password?token=some-valid-alphanumeric-id

How can I get that to route to my endpoint and pass on the token parameter?
I've tried this but to no avail:
'micros-test/guest-reset-password/?token=(?P[a-z0-9-]*)' => 'micros-test/guest-reset-password',

What have I got wrong there?

**Tags:** routing

---

## 1 answers

### Answer by username_1 on 2015-04-16. Score: 2

**Edit** - looks like it's the specific use of `token` as a parameter that's causing the problem.

---

The route doesn't need to account for the get parameters, so it only needs to be `micros-test/guest-reset-password`.

You then fetch the parameter using `craft.request.getParam('token')`.

> **Comments:**
> **username_0**: The problem I have is that when the token is there, the route doesn't resolve and so results in a 404.  
> **username_1**: Sorry you're correct, using `token` does indeed cause a 404 on an otherwise working route. Must be used by the system for something, can't say I've seen it documented though.  
> **username_2**: You can adjust it with the [tokenParam](http://buildwithcraft.com/docs/config-settings#tokenParam) config setting.  

---

