Routing problems: how does it really works
This is an open discussion with 1 reply, filed under Troubleshooting.
Search
Solved with the changes from brendo as seen in this thread.
Create an account or sign in to comment.
This is an open discussion with 1 reply, filed under Troubleshooting.
Solved with the changes from brendo as seen in this thread.
Create an account or sign in to comment.
Quick Links
Symphony • Open Source XSLT CMS
--with-xsl
)
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: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:
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