Using language switcher on Hi site pages returning 404 Topic is solved

General questions regarding the use of languages in Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
talet
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Sat Oct 08, 2016 2:02 pm

Using language switcher on Hi site pages returning 404

Post by talet » Thu Aug 26, 2021 2:01 am

Hi Team,

I have just migrated a multilingual website http://drsupriyawadhwa.com/ (default en and hi) from 3.10 (Protostar) to 4.0 (Cassiopeia). Using language switcher on Hi site pages returns 404, but renders the English site menus properly with sitename/en/ showing in URL (using language switcher on En site pages returns correctly associated Hi pages with sitename/hi/ showing in URL).

Clicking on Home icon on 404 pages, renders the English pages correctly but with sitename/index.php showing, even though I've renamed htaccess.txt to .htaccess and got URL rewriting set to Yes. I have been troubleshooting this for a few days now but I can't find the solution. Have attached debug Trace and Multilingual status images.

1. Both Languages installed and published. Both Content languages created and published
2. Main menus for ALL, en & hi have their own default homepages and different copies of Cassiopeia templates assigned. Menu module for ALL is unpublished. Both language menus/modules are published
3. Multilingual Status is published, shows no issues.
4. Language filter is active - "remove url language code' is set to 'yes'
5. Language switcher is active and published
6. System - Language code is published. Language Codes tab shows en-GB and hi-IN saved as blanks.
7. PHP 7.4.20

Please help. Thanks in anticipation
You do not have the required permissions to view the files attached to this post.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30940
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Using language switcher on Hi site pages returning 404

Post by Per Yngve Berg » Thu Aug 26, 2021 11:14 am

2. A copy of the template style is not necessary for either Protostar and Cassiopeia.

4. Have you tried to turn it off?

talet
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Sat Oct 08, 2016 2:02 pm

Re: Using language switcher on Hi site pages returning 404

Post by talet » Sun Aug 29, 2021 11:59 pm

Thanks Per Yngve Berg,

Had initially migrated site without creating individual template copies for both languages, and encountered this error. At this stage, I had both Hi and En Menus assigned to Cassiopeia (same copy) and published

As part of troubleshooting, I then created individual template copies for both languages and assigned menus and modules (unpublishing Main Menu module), but error remained.

Error persists, even when I turn off Template copies for languages again by going to Template Styles (Site) >> Cassiopeia (default) >> Menu Assignment >> Toggle selection to choose all

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30940
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Using language switcher on Hi site pages returning 404

Post by Per Yngve Berg » Mon Sep 20, 2021 10:01 am

You have set "Hide Language Code" for default language set in the filter plugin. Does it work when you turn that off and you get /en/contact instead of /contact?

talet
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Sat Oct 08, 2016 2:02 pm

Re: Using language switcher on Hi site pages returning 404

Post by talet » Mon Sep 20, 2021 8:49 pm

You fixed it.

I did Dash >> plugins >> System - Language Filter >> Remove URL language code = No >> Save

No 404s when switching Hi to En, but do get /en/contact instead of /contact as you warned.

Many thanks


Locked

Return to “Language - Joomla! 4.x”