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 ....
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 ....
I guess we should improve the "Switch Language" block, by using the canonical URLs instead of those uglyhttp://.../switch_language/1/194/190... links
The new template "seo_flags" introduced inhttps://github.com/concrete5/concrete5/pull/5630... should fix this issue
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
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
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?
- "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?
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
On the SEO front I think this is a must. No body likes a lot of 302 on a site!
/Michael
One little thing... What to do in the 7 branch? I tried with the controller change you applied, but it does not work.
/Michael
/Michael
"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"
In order to make it work with 5.7, you could try to replace
"this->app->make"
with
"\Core::make"
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
I will try your suggestion. Thanks...
Do you plan to do a PR on the 7 branch too?
/Michael
How would you feel if you create a pull request? ;)
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
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
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, ...)
For sure a good GUI helps a lot (TortoiseGit, SmartGit, ...)
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.
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.
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
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
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.
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.
That sounds interesting. Thank's!