Good afternoon!
I use Joomla 4.2.4 (Multi-language) + Language filter (languagefilter) + standard SEF (I don't use anything third-party)
As a result, links of the form are generated: domain.ru/page.html and domain.ru/en/page.html
but if you go, by clicking on the language switcher, to the en version of the site - then back - then it redirects to a URL of the form
domain.ru/page?format=html (although, obviously, this URL does not appear anywhere)
I found out that this problem occurs if you enable the "Remove language code from URL" option in the language filter.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Just work on it and create a pull request when you have fixed it.
I will be glad if you solve this problem. After all, it did not occur to me
alone, I just reported it.
чт, 17 нояб. 2022 г. в 19:50, Benjamin Trenkle @.***>:
Just work on it and create a pull request when you have fixed it.
—
Reply to this email directly, view it on GitHub
#39181 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A4C2TPWUN5ENKDCI2ZPH3LDWIZV57ANCNFSM6AAAAAAR3FOXAA
.
You are receiving this because you authored the thread.Message ID:
@.***>
@Merl06 the comment from @bembelimen was related to the question from @snegicodes . We don't asign issues, if someone has an idea how to solve it, she/he can create a pull request.
install two languages, enable the "language filter" plugin and the
"language switching" module.
In the "language filter" plugin, enable the "Delete default language code"
option. the problem appears when you switch to a version of the material in
which the language is set to the default content language, instead of the
suffix appears "?format=html " the problem only appears if you click on the
language identifier, which is set by default in the "language switching"
module
сб, 19 нояб. 2022 г. в 19:12, Sarthak Negi @.***>:
@Merl06 https://github.com/Merl06 Actually I am not facing the issue
myself, so can you please provide me with the steps to reproduce the bug?—
Reply to this email directly, view it on GitHub
#39181 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A4C2TPXEPA7TALDKVQ5ZY5TWJEDBRANCNFSM6AAAAAAR3FOXAA
.
You are receiving this because you were mentioned.Message ID:
@.***>
I tested overwriting mod_language.
By selection "remove language code from url" all our default language websites don't get the language tag /en/ or /xx/ in the url ! BUT the language switcher add that lang_code to the URL. This is causing a redirect from Joomla and the redirect adds the ?format=html.
The ?format=html is added by the ../plugins/system/languagefilter/languagefilter.php public function parseRule !
To test, copy the link with the code lang_your.domain.com/en/xxxxx.html directly into the browser and you will get the same result your.domain.com/xxxxx.?format=html.
For my proyect i do not like that internal sitelinks are redirected so to correct the wrong URL in the language switcher you can add this script to mod_language default.php. This seems to do the job.
The only thing to have in mind is that the prefix of your language has to be the standard prefix so for en_GB is has to be en! +
This only resoves the problem of the language menu not if some link contains the wrong lang_code!
Add it under each "php foreach ($list as $language)" :
$config =& JFactory::getConfig();
$defaultlang = substr($config->get( 'language' ), 0, 2);
if (!$language->link == '/'.$defaultlang.'/') {
if (substr($language->link, 0, 3) == '/'.$defaultlang) {
$language->link = substr($language->link, 3);
}
}
I don't have the necessary experience and knowledge to fix this, so I'm
asking for help...
сб, 3 дек. 2022 г. в 13:37, Ltaman @.***>:
It's definitely a problem with the joombla redirect and not the language
switcher!To test, copy the link with the code lang_your.domain.com/en/xxxxx.html
directly into the browser and you will get the same result
your.domain.com/xxxxx.?format=html.This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at
issues.joomla.org/tracker/joomla-cms/39181.—
Reply to this email directly, view it on GitHub
#39181 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A4C2TPWDRNLRVFFBAPTDTFLWLMWIXANCNFSM6AAAAAAR3FOXAA
.
You are receiving this because you were mentioned.Message ID:
@.***>
Hi Merl06
The ?format=html is added by the
../plugins/system/languagefilter/languagefilter.php
public function parseRule !
To get rid of it, until someone knows better fix it correctly,
you can add in line 450 below // Redirect to language.
this code:
$redirectUri = str_replace("?format=html", ".html", $redirectUri);
Dear Ltaman, thank you for helping me solve this problem. I followed your
advice and did everything as you wrote, but I did not get the result,
unfortunately ....
сб, 3 дек. 2022 г. в 17:13, Ltaman @.***>:
Adding my code to mod_languages solves the multianguage menu but crawling
the side there are other url get requests with ?format=html.
Joomla docs is pointing to the SEF router:https://docs.joomla.org/URLs_in_Joomla
This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at
issues.joomla.org/tracker/joomla-cms/39181.—
Reply to this email directly, view it on GitHub
#39181 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A4C2TPRXP65RMM3LCUGQXY3WLNPRXANCNFSM6AAAAAAR3FOXAA
.
You are receiving this because you were mentioned.Message ID:
@.***>
Dear Merl06,
first try if you have the same ?format=html problem we are talking about.
Do the following:
Open a random page of your Site in your main language like: https://www.xxxx.com/myarticle.html
add your default language code to the url (if english=en): https://www.xxxx.com/en/myarticle.html
The page should open like this https://www.xxxx.com/myarticle?format=html
If this is happening than you can do this:
Check your Setting;
test again: https://www.xxxx.com/en/myarticle.html should open like https://www.xxxx.com/myarticle.html
If not try to disabel all other thirtparty plugins and/or switch for testing to joombla standart template.
Keep in mind that the changes in ../plugins/system/languagefilter/languagefilter.php will by overwritten by any new joomla update.
So if you did this, I recommend trying to override mod_languages because only this change is really fixing the bad links in the Change Language Menu..
Dear Ltaman, thank you very much. Your advice with 451 lines works fine, I
think this fix will be useful for many Joomla users
вс, 4 дек. 2022 г. в 10:31, Ltaman @.***>:
Dear Merl06,
first try if you have the same ?format=html problem we are talking about.
Do the following:
Open a random page of your Site in your main language like:
https://www.xxxx.com/myarticle.html
add your default language code to the url (if english=en):
https://www.xxxx.com/en/myarticle.html
The page should open like this https://www.xxxx.com/myarticle?formalt=htmlIf this is happening than you can do this:
Check your Setting;
- For Joomla 4.2.5 tested
- Language filter (languagefilter) enable the "Remove language code
from URL" in Language filter plugin
[image: Captura de pantalla 2022-12-04 084829]
https://user-images.githubusercontent.com/2974923/205480145-a8755fb0-dbaa-4213-911b-3c05c06a4f8d.png- My System ->Global Configuration SEO settings:
[image: image]
https://user-images.githubusercontent.com/2974923/205481125-5b11716e-f629-4eb8-883e-78bf18632291.png- Set templetes default language, tested with es :
[image: image]
https://user-images.githubusercontent.com/2974923/205480082-0d697d04-ac25-46b4-bf5d-3533f184aa90.png- for any testing you have to disable all cache functions, if not you
will see only the cached version of your site / if you use Jommla without
thirtparty cache plugins turn off: System ->Global Configuration -> Server
-> System Cache = OFF
- clear the cache: Home Dashboard -> cache -> clear cache
- turn off Plugin System-Page cache
- As first step change only this code in
../plugins/system/languagefilter/languagefilter.php add line 451
[image: image]
https://user-images.githubusercontent.com/2974923/205480212-d0a37806-df2f-461d-9e81-94c8b9bba292.pngtest again: https://www.xxxx.com/en/myarticle.html should open like
https://www.xxxx.com/myarticle.htmlIf not try to disabel all other plugins thirtparty plugins and/or switch
for testing to joombla standart template.Keep in mind that the changes in
../plugins/system/languagefilter/languagefilter.php will by overwritten by
any new joomla update.—
Reply to this email directly, view it on GitHub
#39181 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A4C2TPU272MPBIXHBENF6OTWLRJEVANCNFSM6AAAAAAR3FOXAA
.
You are receiving this because you were mentioned.Message ID:
@.***>
Labels |
Added:
bug
|
Hi,
This issue is still present on Joomla 4.3.3.
It's a small issue but really affects the consistency of a website's URL structure.
The fix posted above seems to be working but involves manually editing a core file which is not ideal.
Are there any predictions for an official fix?
I have had the same issue. But I disable a url suffix in global params and added this redirect to htaccess
RedirectMatch 301 "(.*)\.html$" "$1"
Then all of my pages transfered from site.ru/page.html
to site.ru/page
.
Hi there is a solution for joomla 5? Then the above solution is not working
Big SEO problem with this one still no official fix?
I just checked this and can not reproduce this. Can someone provide a copy of a site where this is happening to debug this?
I just checked this and can not reproduce this. Can someone provide a copy of a site where this is happening to debug this?
Since the problem was not solved and generated many new duplicates, I had to switch to a version without .html. Once I removed the suffix, the problem was solved.
I just checked this and can not reproduce this. Can someone provide a copy of a site where this is happening to debug this?
Since the problem was not solved and generated many new duplicates, I had to switch to a version without .html. Once I removed the suffix, the problem was solved.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-03-29 10:50:14 |
Closed_By | ⇒ | Hackwar |
Since I did not get any further feedback on this and I can't replicate this, I'm closing this one.
Hi there :)
The problem persists in joomla 5.1.0 and joomla 5.1.1. The solution provided here resolves the problem, but you have to repeat the same operation each time you update Joomla.
Thank you.
Screenshot:
Since I did not get any further feedback on this and I can't replicate this, I'm closing this one.
Hello. There is a website where this problem exists, how can I contact you?
Write me at info@joomlager.de
I was able to replicate this. Reopening the issue.
Status | Closed | ⇒ | New |
Closed_Date | 2024-03-29 10:50:14 | ⇒ | |
Closed_By | Hackwar | ⇒ |
The problem is that the languagefilter plugin redirects the URL while parsing the URL instead of after being done with parsing. This results in the URL being partially decoded and the redirect being to that partial URL. The languagefilter plugin needs a bigger rewrite to fix this.
Should we expect a solution in the near future? The problem has simply existed for a long time. Please also pay attention to the problem of tags, I created a topic. The problem is the most serious because it greatly affects SEO.
It depends. Either someone else picks this up or I have to find the time to work on this and to be honest, my volunteer time right now is rather limited. It might take until 5.3 to fix this.
I understand you perfectly, thank you for your work!
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-08-20 08:43:14 |
Closed_By | ⇒ | Hackwar |
Hello!
I just encountered the same problem, exactly as described before me.
When is this expected to be resolved?
I see it has been going on for almost 3 years, is it really that big of a deal that it takes so long to resolve?
J5.2.2
Thx!
ok, what can I do?
Testing Instructions
of the Pull Requestopen https://issues.joomla.org/tracker/joomla-cms/43858 and
Now the test count as successfull.
I would like to work on this issue, can you assign me this one please?
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39181.