0 users online. Create an account or sign in to join them.Users

Search

I asked this already here. But I don't think it is only due to the url router extension but more due to my lack of understanding how the routing works.

I'm busy with a multilanguage website with 10 languages. I don't feel comfortable to do this with the available extensions. So I decided to make my own workflow.

In short the workflow is that I have a section which contains the main language and a helper section which contains the translations and an extra field to make the association with the main language.

For my templates I mostly use an one page appraoch. So I have a page with the following parameters: language/cat/title

So far so good. All basic pages work likes a charm.

Now I need another page to build a product selector. I like to have another page because this page needs other and more (url-)parameters.

But here starts the trouble. The url structure for the basic pages is domain/language/cat/title to start the homepage on an url with the default language code I have a first redirect with the following rule:

From /^$/ to /nl/

For the extra page I like to have the same url structure: domain/language/name-of-the-page/[more-params]. I give this page at least the parameter: language

Logical for me I thought a rewrite (silently route) should do the trick:

From /$1/name-of-the-page/ to /name-of-the-page/$1/

Off course this should be also more general with the page variable (/$1/:page/) so it should work for all future pages.

But the result is 'a page not found' and if I 'force the re-route even if page exists' I land at the index page.

A redirect with the same rule as above works but of course the url is different (domain/name-of-the-page/language) from what is desired (domain/language/name-of-the-page)

I'm quite confused why the routing isn't working as expected. It feels for me that when I choose for 'route' the system stucks at the index page. That explains the page not found error because 'name-of-the-page' isnt a valid (required) parameter voor $cat. That also explains the 'force re-route' result because all page parameters are empty so it's true to show the front page.

My question: is this the behaviour as intended and do I think wrong about routing? Or is this a bug in the core or the url router extension?

Working with 2.5.1

Solved with the changes from brendo as seen in this thread.

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