WebsiteBaker Community Forum

WebsiteBaker Support (2.12.x) => Modules => Topic started by: CodeALot on October 10, 2019, 02:16:28 PM

Title: WBLingual - how to get rid of ugly URL
Post by: CodeALot on October 10, 2019, 02:16:28 PM
When switching from one language to another (in this case, to English) the URL of the 'landing page' shows unwanted variables.   (?_wb=.... etc)
Code: [Select]
https://exampledomain.com/en/what-we-do/?_wb=en/what-we-do/

Am I overlooking something? Doing something wrong? :)  I don't want ugly URL's

WB 2.12.2 r379
WBLingual 2.0.2
ShortURL active
Title: Re: WBLingual - how to get rid of ugly URL
Post by: hgs on October 11, 2019, 08:38:06 AM
I can confirm that,
https://domäne.org/de/gallery/?_wb=de/gallery/
AFTER another "click" in the language
https://domäne.org/de/ueber-uns/
it is then clean again, so only when changing the URL via the flags the URL is "wrong".
What do the developers say?
Title: Re: WBLingual - shorturl - how to get rid of ugly URL
Post by: dbs on October 11, 2019, 09:04:23 AM
Halrald, you have also shorturl active.
?_wb= is part of the htaccess code for shorturl.
Title: Re: WBLingual - how to get rid of ugly URL
Post by: astricia on October 11, 2019, 10:43:31 AM
I had this problem on a website a few months ago and contacted Ruud about it, since he developped shorturl. He said this was caused by WebsiteBaker and he made "a small change in class.frontend.php" to prevent this happening. It worked - but unfortunately I don't know what exactly he changed....

I have attached the new class.frontend.php from that particular server (as txt - you need to rename it), so maybe this helps.

Astrid
Title: Re: WBLingual - how to get rid of ugly URL
Post by: hgs on October 11, 2019, 10:56:16 AM
Halrald, you have also shorturl active.
?_wb= is part of the htaccess code for shorturl.
Yes I have shortURL active
Title: Re: WBLingual - how to get rid of ugly URL
Post by: dbs on October 11, 2019, 11:00:13 AM
@astricia: thanks, to you and Ruud. Seems to work. File ist from 2.12.1 but the change is the same for 2.12.2
framework/class.frontend.php line 192. change this:
Code: [Select]
\header('Location: '.$this->page_link($this->page['link']).'?'.$_SERVER['QUERY_STRING']);to this
Code: [Select]
\header('Location: '.$this->page_link($this->page['link']));
Title: Re: WBLingual - how to get rid of ugly URL
Post by: hgs on October 11, 2019, 11:12:28 AM
 (Y)
Then, if there are no concerns from the developers, it should be transferred to the next version like this.
@dbs please create a ticket, because my internet is currently very slow on vacation.
Title: Re: WBLingual - how to get rid of ugly URL
Post by: hgs on October 11, 2019, 01:54:49 PM
Tested on a bilingual site. Everything runs as it should. (Y)
Thanks to all
Title: Re: WBLingual - how to get rid of ugly URL
Post by: CodeALot on October 11, 2019, 03:01:18 PM
Works! Thanks all  8-)
Title: Wblingual
Post by: crnogorac081 on October 11, 2019, 05:34:46 PM
I would like to ask what is happening with link eg. http://wb_url/my_pretty_url/?page=2 (http://wb_url/my_pretty_url/?page=2)

Is _get('page') going to be dumped too if we apply the proposed fix :?

I would suggest to only remove _wb from $_SERVER['QUERY_STRING'] if exists..
Title: Re: WBLingual - how to get rid of ugly URL
Post by: dbs on October 12, 2019, 03:37:49 PM
Dev Dietmar will take a look at the change. The way I see it, there will be another solution.