SEF Plugin with 'Strict routing' OFF
Open a URL like http://joomla60dev/index.php?option=com_mycomponent&view=myview&lang=en
URL stays the same
URL gets redirected to its SEF version
So there is a discrepancy between the parameter and the actual behavior
Labels |
Added:
No Code Attached Yet
|
@brianteeman of course, but there should not be SEF redirecting from non-SEF to SEF version of a URL
of course there should. that is how joomla has always worked. Ever since 1.0
@brianteeman maybe i didn't express myself correctly.
What i mean is that if you open:
http://joomla50dev/index.php?option=com_mycomponent&view=myview&lang=en -> URL stays the same, no redirect
if you open:
http://joomla60dev/index.php?option=com_mycomponent&view=myview&lang=en -> URL does not stay the same, redirects to
http://joomla60dev/component/mycomponent/?view=myview
Never worked in this way, So it looks no longer possible to access a raw URL without a redirect using the GET method.
@brianteeman maybe i didn't express myself correctly.
What i mean is that if you open:
http://joomla50dev/index.php?option=com_mycomponent&view=myview&lang=en -> URL stays the same, no redirect
if you open:
http://joomla60dev/index.php?option=com_mycomponent&view=myview&lang=en -> URL does not stay the same, redirects to
http://joomla60dev/component/mycomponent/?view=myview
Never worked in this way,
Just for testing what happens when you don't add the lang= param
Without lang = param then it works as supposed, the URL keeps to stay original like:
http://joomla60dev/index.php?option=com_mycomponent&view=myview
I asked because there was possibly a similar issue reported on 5.3 and that was the language param on a non multilingual site
The redirect happen at this point
joomla-cms/plugins/system/sef/src/Extension/Sef.php
Lines 114 to 119 in fe22ff2
I did not debugged deeper.
I cannot say is it bug or feature.
When I disable SEF then I get no redirect, so kind of nothing wrong.
To be clear. You are setting lang param on a non multilingual site?
@brianteeman i'm setting the lang param on a multilingual site
ok - thanks for clarifying that - its a different issue then to the one I mentioned earlier
This has nothing to do with the lang parameter. This is a new feature to redirect URLs which we were able to parse correctly, but which are not the "canonical" SEF URL to the correct URL. It only happens for GET requests and you can of course still access raw URLs. You are just being redirected to the correct version of the URL then.
@brianteeman You're welcome, and thank you.
@Hackwar In that case, the situation is even more concerning. This new feature cannot be enabled by default. At the very least, there should be a setting for it, similar to the 'Strict routing' option in the SEF plugin.
Consider a component like Joomshaper SPPB, which uses an iframe for its editor. A GET request for that iframe (e.g., http://joomla60dev/index.php?option=com_sppagebuilder&view=form&id=23&layout=edit-iframe&Itemid=0&lang=de) would be processed into a canonical SEF URL. This redirection could cause issues, as the raw URL may not function identically after the redirect, potentially breaking functionality in many cases.
@Hackwar I think the issue is here
joomla-cms/plugins/system/languagefilter/src/Extension/LanguageFilter.php
Lines 379 to 387 in cde2124
The missing check for $lang
form Uri.
When change the code to:
} elseif (!isset($this->sefs[$lang])) {
// No language is set, so we want to redirect to the right language
$router->setTainted();
}
// The language was set both per SEF path and per query parameter. Query parameter takes precedence
if ($lang && isset($this->sefs[$sef])) {
$uri->setVar('lang', $lang);
$router->setTainted();
}
Then all seems works.
But maybe there a better way, or i missed something still.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-08-23 08:17:08 |
Closed_By | ⇒ | Fedik |
Labels |
Added:
bug
|
Strict routing off does not mean SEF off