title: Custom pagination route using CakePHP 2.3.1
body: <p>I am using cakephp 2.3.1 and I have problem with Paginator Component.</p>
  
  <p>My goal are pages like:</p>
  
  <pre><code>example.com/abruzzo
  example.com/abruzzo/2
  example.com/abruzzo/3
  </code></pre>
  
  <p>I have created the follow route:</p>
  
  <pre><code>Router::connect('/:regione/:page', array('controller'=&gt;'regions','action'=&gt;'home'), array('page' =&gt;'[0-9]+'));
  Router::connect('/:regione', array('controller' =&gt; 'regions', 'action' =&gt; 'home'));  
  </code></pre>
  
  <p>(as you can see the first route work handle the <strong>page</strong> param)</p>
  
  <p>Now, to handle the page param correctly, I added the follow line to RegionsController's <strong>beforeFilter</strong>.</p>
  
  <pre><code>public function beforeFilter()
  {        
      $this-&gt;request-&gt;params['named']['page'] = (isset($this-&gt;request-&gt;params['page'])) ? $this-&gt;request-&gt;params['page'] : 1;
  }
  </code></pre>
  
  <p>because I read the Paginator componenet will look ad ['named']['page'] instead of ['page'] directly.</p>
  
  <p><strong>FIRST QUESTION:</strong></p>
  
  <p>Is this correct? do I really need this hack in beforeFilter() ?</p>
  
  <hr>
  
  <p>Then, I Need to show the numbers of the pagine using: </p>
  
  <pre><code>&lt;?php echo $this-&gt;Paginator-&gt;numbers(); ?&gt;
  </code></pre>
  
  <p>The problem here is that the URL created on the link are wrong.. they point to:</p>
  
  <pre><code>example.com/regions/home/page:2
  example.com/regions/home/page:3
  etc...
  </code></pre>
  
  <p>I <strong>do not</strong> need URLs like these, I need:</p>
  
  <pre><code>example.com/abruzzo
  example.com/abruzzo/2
  example.com/abruzzo/3
  </code></pre>
  
  <p><strong>SECOND QUESTION:</strong></p>
  
  <p>How could force the url i want instead of controller/action/page:N format?</p>
  
  <p>Thanks!</p>