[#33194] change language redirect with language code from 303 to 301#5092
[#33194] change language redirect with language code from 303 to 301#5092lunalars wants to merge 2 commits intojoomla:stagingfrom
Conversation
|
I'm not sure at all a 301 is correct in this scenario:
But there seems to be a consensus that 301 is not a good choice... See: http://stackoverflow.com/questions/8325784/http-status-code-for-language-redirect |
|
I also would say 301 is wrong. |
|
Let me explain a bit more: Example: |
|
In that example you should really be using the option in the plugin NOT to On 12 November 2014 10:40, Lars Vonnahme notifications@github.com wrote:
Brian Teeman |
|
First: thanks for looking at this! SEO is pure fun: 10 people, 20 opinions ;-) @smanzi @Bakual @brianteeman Ok, as i said: will talk to my seo expert and report back tomorrow (or maybe on friday). |
|
If you are not online yet I'll surely follow @brianteeman advice and use the option of hiding the language code for the default language. Google will be really happy... |
|
@lunalars I was using "Remove URL Language Code" set to "yes" for a year or more. So, for the default language "el" the links were redirected and removed "el" from the urls. And don't know why, but 2 weeks ago i got duplicated content from this option, so i decide to use language code, for both languages and i disabled this option. it makes more sense. (check the image). From a seo perspective this is wrong. The language code should not be removed from the url. It's not logic for one language to use the code and for another not. Google likes urls to make sense even if something is obvious. Of course this is only my opinion and probably we are here because google is making changes.. ;) |
|
@smanzi I am not lunalars :) Thanks for your help I am not using "remove language url code from url" any more. But the duplicated content is been indexed as the image above because i was using "remove language code" and associations with menus and articles. I think this is my issue #5092. How the duplicated content is going to be fixed with 303 redirects? I think i need 301. Sorry but i am not an expert. :) |
|
@ManuxGR Ooops! Sorry for mixing up usernames!
|
|
@smanzi Thanks once again for your reply. |
|
@smanzi "Be patient!" - agree! The most important part of our work on seo :-) Didn't test, but agree with @smanzi : #4221 should fix (at least a part) of the duplicated content problem. But if i remember correctly, there is (or was?) a similar problem with languageswitcher, which also adds the languagecode. Talked to my seo expert today and he thinks, that it's more logical to use the languagecode for all languages as this results in a more unified url structure (and he did it succesfully like this in 2 other non-joomla projects). So, in this case we really need the 301 as there is no url without languagecode anymore. @ManuxGR I'm not sure what to do in your situation, but would again follow my seo expert and say it's for now better to keep the languagecode. But then - as you said - you would need the 301. If you are willing to pay the price, you could go with the core-hack for now, too. To me it seems there are different ways to do it right. Also i remember reading on google help page (sorry, again no link) that you can do it in different ways, as long as you avoid really bad things. Maybe, as there are these different opinions and needs, we can implement an options for this, to handle them? Yes, not too many options, please :-) |
|
@lunalars Thanks for your opinion and for asking your seo expert. I agree. :) But @smanzi is a coder and we need his detailed opinion so we can make a final decision that will work permanently. I don't get it with #4221, this fix is only working when "remove url language code" is set to "yes" and because of language switcher pointing to wrong link and then a 303 redirect will apply. |
|
@ManuxGR me? a coder? You are greatly overestimating me! Well, I've been coding more or less since 1980, and two hands are not enough for enumerating the languages I had to learn, but as a Joomla coder I'm a real noob! Now you will forgive me, but I have to make some history to wrap up what the problem is (and yes, IMHO we still have a problem). I opened the #4215 issue because I discovered what I think is a bug in the Language Switcher module (remember, we have a Language Switcher module and a Language Filter plugin): Language Switcher generates links for the default language where the language code is not suppressed even if we set the Remove URL Language Code option. Soon the attention shifted to a similar bug in the language filter and the rel="alternate" links it generates. This latter aspect was quickly fixed by @infograf768 with PR #4221 But... @infograf768 had some afterthoughts and closed the PR. A long discussion erupted that was finally cleared up by a SEO expert, @jessicadunbar with this post: #4221 (comment) At this point #4221 saw the light, a similar PR #4425 for Joomla 2.5 was created and... everybody (including myself) forgot about the initial issue with the language switcher module! So, here we are: Joomla is still responsible for the creation of double-indexed content (even when #4221 is applied) if we set the Remove URL Language Code option (I have evidence of this with a live site). But... going to the wrong URL generated by the language switcher yield to a redirect to the correct one with a The w3.org document about status codes (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) is not very clear about the 303. What I've read around, anyway, is that a 303 (contrary to a 301) does not pass page rank to the page to which one is redirected and is accepted as a valid URI, although the cached page is the one to which one is redirected. See http://www.marketingchip.com/seo-experiments/how-does-a-303-redirect-affect-seo/ very interesting At this point I would say that:
|
|
My bad! Last line read:
|
|
Untested yet, but: if you accept not having the language code for the default language it should be quite easy to de-duplicate all URLs by putting this in .htacces: If gr is your default language code. I see it more difficult to redirect naked pages to the ones with the default language code... anybody has an idea? |
|
... no the above doesn't works: I have to think it over... :-/ |
|
@smanzi don't bother about htaccess, finally i will use code language for both languages and 301 redirects instead of 303. And i wish me good luck... once again..... Many thanks for you support and for explain me so detailed, you are so helpful. I am glad they are people like you around and lunarars. :) I am reading the links you attached. |
|
I've created two new PRs that are "language related":
There will be more to discuss as (after many and many tests) I've come to the conclusion that the possibility to eliminate the language code for the default language, while absolutely legit and without negative SEO impact if correctly implemented, is, at this time, full of issues and just a bit more of a kludge |
|
The point here imho is to decide which is better: a 303 or a 301. Code is another matter. |
|
301, we have evidence that 303 created duplicated content. And language switcher should be fixed for next version so new websites dont have this problem. |
|
As I commented on #5109, this will not work because of the set cookie. |
|
@lunalars and all
I created a new PR for you to test: |
|
@infograf768 and all |
|
Please just test #5129 |
|
@infograf768 |
|
@lunalars |
|
@infograf768 |
|
no. |
|
It's working properly for me. But what about negative SEO from bad competiros? The url above is from secondary language and probably can not be find by spiders or humans so it's ok. I am just saying this could be a security whole or not? Sorry this was for #5129 |
|
@infograf768 I've yet to test, but I think the condition @lunalars want to handle is the opposite:
|
|
Yes sorry this was for #5129 |
|
oops! |
|
Ref: #5092 (comment)
I have no idea what you are talking about. If the link is a real 404, it's OK I guess. |
|
Ok i forget about this |
|
Again, when set to NO, there is NO 303. |
|
@infograf768 sorry if I post here again, but as you replied here I think it is better to keep all together. You are right that there are no programmatically generated redirects, but there can be if one changes his site configuration from yes to no. |
|
Sorry, but i get a 303 :-) |
|
Now i've set up a test site at http://www.lunadev.de with pure joomla 3.3.6 (if i should update to latest staging, please tell me!).
Imagine the site had only 1 language (german) before and google has indexed all URLs without language code. Now you just added english as the second language and applied the settings above. You can check this at http://redirectdetective.com : Eveything else works fine! No other redirects when using menu or language switcher on the site. I hope this makes it more clear. If i mix up something, please tell me. |
|
The real url of this site is: If you had an old homepage |
|
Also, please post now in |
|
Just one more question, as i think this does not belong in #5129 : |
If the path is the same after "http://www.lunadev.de/", it will work. |
|
This does not answer my last question. |
|
Lars, I would probably try to handle your situation within .htaccess |


On a multilingual site urls called without the language code are redirected by a "303 see other" instead of "301 moved permanently".
The code used here is the "first half" of https://github.com/joomla/joomla-cms/pull/2845/files provided by infograf768 (thanks!).
Edit:
Please note: this PR is only applying if "Use URL rewriting" is set to "Yes" and "Remove URL Language Code" is set to
"Yes""No" !Steps to reproduce the issue:
a. "Language Selection for new Visitors" to "Site Language"
b. "Automatic Language Change" to "Yes"
c. "Item associations" to "Yes"
d. "Remove URL Language Code" to
"Yes""No"Expected result:
The first redirect shown in the network tab should be a 301 redirect as the url without the language code is no longer available, and so it should be redirected "permanently".
Actual result:
The redirect is a "303 see other".
System information:
PHP 5.5.9-1ubuntu4.5
MySQLi 5.5.40-0ubuntu0.14.04.1
Caching Disabled
GZip Disabled
Additional comments:
After applying the patch, the redirect is a "301 moved permanently".
This was addressed a while ago on the old tracker:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33194&start=8400
and there were some problems with cache enabled mentioned by Jean-Marie Simonet.
So please test with and without cache enabled.
And sorry for adding the changed gitignore file here - i don't know how to remove it from the PR - still new to git.