302 Redirect issue with multilingual sites

Permalink
Hi everyone
I have a few multilingual hotel sites (running on 5.7.5.6 and 5.7.5.9) 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 ....

1 Attachment

pixeljunkie
View Replies:
mlocati replied on at Permalink Reply
mlocati
I guess we should improve the "Switch Language" block, by using the canonical URLs instead of those uglyhttp://.../switch_language/1/194/190... links
mlocati replied on at Permalink Reply
mlocati
The new template "seo_flags" introduced inhttps://github.com/concrete5/concrete5/pull/5630... should fix this issue
maar replied on at Permalink Reply
maar
I have tried this on a demo site of ours, and it seem to work as expected (I get "200" response all over).

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!

/Michael
mlocati replied on at Permalink Reply
mlocati
It can't be in all core templates:
- "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?
maar replied on at Permalink Reply
maar
As I see it - the old way is directly SEO wrong. And I think all templates and the core view.php should be changed. I see the issue with "flags_set_default", but that might be just that.

On the SEO front I think this is a must. No body likes a lot of 302 on a site!

/Michael
maar replied on at Permalink Reply
maar
One little thing... What to do in the 7 branch? I tried with the controller change you applied, but it does not work.

/Michael
mlocati replied on at Permalink Reply
mlocati
"It does not work" is not that informative... ;)

In order to make it work with 5.7, you could try to replace
"this->app->make"
with
"\Core::make"
maar replied on at Permalink Reply
maar
I'm sorry for the lack of information. I'm a little stressed - my wife decided to clean up the whole house.

I will try your suggestion. Thanks...

Do you plan to do a PR on the 7 branch too?

/Michael
mlocati replied on at Permalink Reply
mlocati
How would you feel if you create a pull request? ;)
maar replied on at Permalink Reply
maar
I'm not sure what to answer to that question :-)
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!

/Michael
mlocati replied on at Permalink Reply
mlocati
You should really learn git. It's not only useful when contributing to the core: you can use it in a local-only way too, to save the state of your projects and be able to see the history (and revert changes if you make mistakes).
For sure a good GUI helps a lot (TortoiseGit, SmartGit, ...)
mlocati replied on at Permalink Reply 1 Attachment
mlocati
I created a pull request on GitHub (https://github.com/concrete5/concrete5/pull/5667... ), so that future versions of the concrete5 5.7 series will have this fix (but I don't know if we'll have other 5.7 releases).

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.
maar replied on at Permalink Reply
maar
Why are you such a nice guy?

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 :)

/Michael
mlocati replied on at Permalink Reply
mlocati
Thanks for your kind words ;)
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.
maar replied on at Permalink Reply
maar
That sounds interesting. Thank's!