Search

My site has two pages with pagination based on URL query parameters:

  1. http://mydomain.com/?page=N
  2. http://mydomain.com/archive/?page=N

I'm rewriting these URLs with the URL Router extension so that they're available as:

  1. http://mydomain.com/page/N
  2. http://mydomain.com/archive/page/N

I expected the two versions of the URLs to be identical but they produce different results, e.g.

http://mydomain.com/?page=4 gives:

//params/url-page = 4
//my-data-source/pagination/@current-page = 4

and http://mydomain.com/page/4 gives:

//params/url-page = 4/
//my-data-source/pagination/@current-page = 4/

Where do the trailing slashes come from? I didn't get them when I was using a .htaccess RewriteRule. Could it be an issue with my URL Router settings?

From: archive/page/:page
To: /archive/?page=:page

From: page/:page
To: /index/?page=:page

I'm using Symphony 2.5.1 and URL Router 3.0.

From my experience, Symphony adds the trailing slash to make the URL look awesome.

You need to exclude the trailing slash in your pattern. Thats what I had to do when working with routes and redirects.

Trailing slashes in URLs aren't the problem. I'm talking about the XML that Symphony returns.

Re your suggestion, if you mean remove the trailing slashes in my stylesheets, I'm doing that now. I'm just wondering if there's a more elegant solution. Seems like a hack to work around some strange behaviour.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details