Body: <p>I am migrating an old EE site to Craft. The EE site has a filter feature for certain weblogs. It outputs a list of entries for a weblog filtering on year, program, etc... which are passed as URL parameters.</p>
  
  <p>I'd like to continue doing the same on the Craft site. I've setup custom routes to handle the url parameters. The following for example:</p>
  
  <p><a href="https://i.sstatic.net/8tqFW.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8tqFW.png" alt="custom route examples with and without pagination url segment"></a></p>
  
  <p>With {% paginate %} using something that looks like this (a bit simplified):</p>
  
  <pre><code>{% paginate craft.entries.section('videos').limit(10).order(fSort).date(fYear).relatedTo(fCategory).relatedTo(fProgram) as pageInfo, pageEntries %}
  
  &lt;div class="pagination"&gt;
    {{...various pagination links using pageInfo...}}
  &lt;/div&gt;
  
  &lt;ul class="videolist"&gt;
    {% for entry in pageEntries %}
    &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
    {% endfor %}
  &lt;/ul&gt;
  </code></pre>
  
  <p>The initial page of entries and pagination links outputs fine. But when going to subsequent pages via a pagination link (e.g., adding "p2" at the end of the URL), it can't find the route.</p>
  
  <p>Does native pagination not work with custom routes? I tried different tokens for the pagination segment, but nothing seems to work.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-08T17:08:17.353Z
Comments.Text: I wonder if your route ending in `page` is causing trouble, because I definitely have a working custom route _with_ functional, native pagination. Have you experimented with the [pageTrigger](https://craftcms.com/docs/config-settings#pageTrigger) setting? You might as well share some of the attempted (and not working) paging URLs you've tried just for good measure.
Comments.UserDisplayName: Matt Stein
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-08T22:50:36.563Z
Comments.Text: I'm with @MattStein... my guess is it's conflicting with the default pageTrigger config setting value.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-09T15:38:27.027Z
Comments.Text: Good to know it is supposed to work @MattStein, but does your case specifically involve dynamic url tokens? I had it set up initially without a second custom route with `page`, but that is when I noticed the issue - so added it to test it (without luck).
  
  I have modified the pageTrigger. No difference. If there are url parameters, it won't work. If there are no url parameters, it works. Seems to be a conflict with custom route dynamic url tokens and url pagination. I do see a weird error in the logs, so in the process of debugging this to see if it impacts this issue.
Comments.UserDisplayName: Nomad Guy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-09T17:31:00.013Z
Comments.Text: It does indeed @NomadGuy, the only differences between yours and mine are fewer tokens overall and that my rules are defined in config/routes.php. It sounds like this could also come down to your server configuration if URL parameters are problematic. If you're still stuck, you might add more details about your server setup, various URL attempts, and definitely the weird error from the logs. This should very much be working.
Comments.UserDisplayName: Matt Stein
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-05T01:20:01.823Z
Comments.Text: I think I might have figured out what the issue pertains to. I have been testing with different amount of number tokens and what those values are. It seems like the pagination breaks if one or more of the url segments are set to "0". Though I don't see a clear pattern as to the sequence and number of 0's that will trigger it.
Comments.UserDisplayName: Nomad Guy
Tags: <url><routing><pagination>
Title: Custom Routes with URL Parameters and Pagination
ThreadText: # Custom Routes with URL Parameters and Pagination
  
  (Asked by: username_0 on 2017-06-08)
  
  I am migrating an old EE site to Craft. The EE site has a filter feature for certain weblogs. It outputs a list of entries for a weblog filtering on year, program, etc... which are passed as URL parameters.
  
  I'd like to continue doing the same on the Craft site. I've setup custom routes to handle the url parameters. The following for example:
  
  [![custom route examples with and without pagination url segment](https://i.sstatic.net/8tqFW.png)](https://i.sstatic.net/8tqFW.png)
  
  With {% paginate %} using something that looks like this (a bit simplified):
  
  ```
  {% paginate craft.entries.section('videos').limit(10).order(fSort).date(fYear).relatedTo(fCategory).relatedTo(fProgram) as pageInfo, pageEntries %}
  
  <div class="pagination">
    {{...various pagination links using pageInfo...}}
  </div>
  
  <ul class="videolist">
    {% for entry in pageEntries %}
    <li><a href="{{ entry.url }}">{{ entry.title }}</a></li>
    {% endfor %}
  </ul>
  
  ```
  
  The initial page of entries and pagination links outputs fine. But when going to subsequent pages via a pagination link (e.g., adding "p2" at the end of the URL), it can't find the route.
  
  Does native pagination not work with custom routes? I tried different tokens for the pagination segment, but nothing seems to work.
  
  **Tags:** url, routing, pagination
  
  > **Comments:**
  > **username_1**: I wonder if your route ending in `page` is causing trouble, because I definitely have a working custom route _with_ functional, native pagination. Have you experimented with the [pageTrigger](https://craftcms.com/docs/config-settings#pageTrigger) setting? You might as well share some of the attempted (and not working) paging URLs you've tried just for good measure.  
  > **username_2**: I'm with @username_1... my guess is it's conflicting with the default pageTrigger config setting value.  
  > **username_0**: Good to know it is supposed to work @username_1, but does your case specifically involve dynamic url tokens? I had it set up initially without a second custom route with `page`, but that is when I noticed the issue - so added it to test it (without luck).  I have modified the pageTrigger. No difference. If there are url parameters, it won't work. If there are no url parameters, it works. Seems to be a conflict with custom route dynamic url tokens and url pagination. I do see a weird error in the logs, so in the process of debugging this to see if it impacts this issue.  
  > **username_1**: It does indeed @username_0, the only differences between yours and mine are fewer tokens overall and that my rules are defined in config/routes.php. It sounds like this could also come down to your server configuration if URL parameters are problematic. If you're still stuck, you might add more details about your server setup, various URL attempts, and definitely the weird error from the logs. This should very much be working.  
  > **username_0**: I think I might have figured out what the issue pertains to. I have been testing with different amount of number tokens and what those values are. It seems like the pagination breaks if one or more of the url segments are set to "0". Though I don't see a clear pattern as to the sequence and number of 0's that will trigger it.  
  
  ---
  
  ## 0 answers
  
  