Install Joomla on a server running nginx as a proxy to Apache.
Enable multi language.
Open homepage.
The language filter plugin should redirect https://my.site/ to https://my.site/en
A redirect is done to https://my.site/en/ with a trailing slash. Since "en" is not an existing directory in the web root, nginx returns a 404 not found HTTP status. When path is empty (while building the new url in the language filter plugin I assume), there should not be a trailing slash.
Plesk Onyx Version 17.8.11 Update 31
CentOS Linux 7.5.1804
PHP 7.2.12
Percona 5.7.23-25
Joomla! 3.9.1
I've searched the net for a while. There are more people running into issues caused by the trailing slash. Most of them edit the .htaccess file to remove the trailing slash, causing difficulties with /administrator and some other links. Always having two redirects is far from ideal. It's also a workaround instead of a solution to the actual problem.
The same trailing slash is added in a blog type link. https://my.site/en/blog/ should be https://my.site/en/blog
Cheers, Willem
btw, I do not have here a trailing slash for any menu items except home before this proposed patch.
But it could solve your issue if you get one.
The .diff proposed deals with menu items, language switcher and hreflang and is in my tests case specifically useful for Homes.
Hi, thanks for the quick reply!
For me also, all the normal links to articles don't have a trailing slash.
If I understand correctly, you strip the trailing slash off of any link. On one hand that seems very reliable because it would work on all links processed by this code. On the other hand, wouldn't it be better to not add the slash there in the first place? So far I've only seen it happen in the language plugin and blog type link. For consistency and efficiency I'd probably change those instead of repairing it afterwards.
Don't get me wrong though, I really appreciate your effort!
Willem
The way I see it, the trailing slash is specific to multilingual sites and even more specific to the Home pages of such sites where only the sef url language code is displayed after the domain or after TLD/index.php
Therefore this PR deals only with the multilingual module switcher and language filter plugin.
As I said, I can't reproduce the trailing slash for any other loaded page, including /blog
but I guess the pr would solve your issue too. Please test.
Status | New | ⇒ | Information Required |
any Comment @DeWillem78 or can this Issue be closed?
any Comment @DeWillem78 or can this Issue be closed?
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-03-16 07:04:39 |
Closed_By | ⇒ | franz-wohlkoenig |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/23209
Closed as no Answer, please reopen if needed.
I have posted a possible solution on the forum.
I am not sure it would be B/C. @mbabker ?
Here is the .diff to test