Redirecting from-to URLs with query strings
-
Hi there!
Polylang: Version 1.8.5
Permanlink settings: Post name
Static front page: yes
Polylang selected settings:- The language is set from content
- Hide URL language info for default languages
- Remove /language/ in pretty permalinks
- The front page url contains the language code instead of the page name or page id
A little bit of context first:I am using a theme called mee theme, all my pages are shown as it is only one single page layout (displaying pages as sections) and the way they handle the URLs is still a mystery for me.
Basically, I can call any page in the usual way (as in my permalink settings) and it will show only that page as expected, but if I use a “query string” (“https://<baseURL>/?page=<mix between page title and slug>”) URL all my pages are shown in a OnePage layout site and a slide animation will be triggered to move the user to the correct page.
My translation problem is related when this OnePage layout is used, now bear with me:
- I am guessing that polylang does not detect that I am in a page different to front page, so it always redirects to the front page when I use the language switcher. For example, if I am in “https://<baseURL>/?page=contact” and I click in the 2nd language of the language switcher, I will get redirected to the front page (OnePage layout) of my 2nd language and not to the OnePage translation of the current page, the slide animation won’t be triggered, and the URL will be “https://<baseURL>/de”
- If I manually introduce the URL “https://<baseURL>/de/?page=kontakt” I will get a “Sorry, no posts matched your criteria” message, instead of loading my OnePage layout site (in German in this case) and slide to the Kontakt page.
So my question really is: Is there a way to use filters like “pll_translation_url” or “pll_the_language_link” to customize the translation URLs base on the current URL? From “https://<baseURL>/?page=contact” to “https://<baseURL>/de/?page=kontakt”. Would this do the trick?
If not, how could I achieve that?
Test website: here
Extra unrelated info: “/?page=introduction” and “/?page=thankyou” are working as header and footer. These sections are automatically added to the site (they are not pages created by me).
Thanks in advance!
- The topic ‘Redirecting from-to URLs with query strings’ is closed to new replies.