302 Redirect issue with multilingual sites
I have a few multilingual hotel sites (running on 18.104.22.168 and 22.214.171.124) that produce issues revolving around google indexing:
Some sub-sites just don't get indexed, apparently due to a 302 redirect ...
I am using the Page Selector Attribute addon and the Page Redirect addon. If I run my site through a SEO tool, like Screaming Frog, i., I get loads of 302's, all related to switch language (see screen below). Only pages without children from the main locale appear in google results.
For checking purposes, I ran a few not-C5 sites through the tool as well, with no 302's at all.
I ran a C5-single language site through the tool ... no 302's at all.
I have seen the same tested on an 5.8.2 multilingual install .... and it happenend again.
What can be done to avoid this? I do depend on relieable SEO-options ....
Will this be changed in all core templates and the main view.php of the Switch Language block?
By this being an essential SEO problem I thought this was a good idea!
- "flags_set_default" does something more than just switching to a new page
- the default template does a POST in order to switch the language, so the destination page is already not found by search engines (that only follow direct links).
So, only the "flags" template could be updated.
The question is: should we update the "flags" template, or add a new "seo_flags" template like I suggested in the GitHub pull request?
On the SEO front I think this is a must. No body likes a lot of 302 on a site!
In order to make it work with 5.7, you could try to replace
I will try your suggestion. Thanks...
Do you plan to do a PR on the 7 branch too?
My git knowledge is kind of small. I tried to set it up ones and I think it worked but not totally understanding why. Ronny might teach me (my colleague). But I think it will take some time...
I'll see what I can do!
For sure a good GUI helps a lot (TortoiseGit, SmartGit, ...)
For those wanting to fix this issue, I created a custom template for the Flags template. Extract the attached archive in the root of your website (it will create the directory application/blocks/switch_language/templates/seo_flags and 2 files in it), and choose the new "Seo Flags" block template.
I was actually talking with Ronny about how to begin using Git. I'll not stop that, I'll promise you that! But how long time I have to use before I feel comfortable to do core PR - I don't know!
But I have to say thanks for this, and I know that pixeljunkie will jump a few times :)
We all love concrete5, and since its community is one of its key points, I try to do my best to support it.
About git: once you'll learn it you won't be able to live without it. Maybe the next time I'll install my PC I'll record a video to show all the required steps to initialize the environment and create a pull request the right (and easy) way.