-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hreflang tag to default language #819
Conversation
If flag Hide URL language information for default language is active - hreflang to default language anyway include lang-pach. Changing qtranxf_convertURL to defalult false - fix this problem
I don't think we should this, see this discussion in #198. It is a bit difficult to understand but the reason to have the explicit language even with the option "hide default language" is to resolve the ambiguity from requests generated from SEO robots, despite the fact it generates a temporary redirection (i.e. the URL stored by the SEO is not a canonical one in that case). |
See #826: added a new filter |
This topic is quite a complex question. I'm not sure about the right answer. Still need to think more about it... |
@antonzol I've reflected on this and i think the main behavior of qTranslate is correct in the default case. This is explained in the Wiki about redirections but maybe it is easier to understand with an example. I will take the example from #198.
In this example the default language on the server is The question is about the first link. You would want it to use the default URL without language (like the one of
Problem: with that link, qTranslate will normally negotiate the language the first time with your browser and store it in a cookie. Let's consider:
The result is said to be non-deterministic: you don't know in advance the result because it depends on user parameters. So it would be wrong if the SEO assumes the default link is always However - there is one special case mentioned by @nb000 in #198. If you disable the language negotiation (Languages / General / Detect Language Browser) you could assume the language is going to be fixed, therefore deterministic. In that case, the Also one very extreme case would be if the user changes the cookie by external means, or for some reasons already have this cookie set (because the website had the auto detection first and removed it later). We may even consider the two conditions together (disable auto detect AND disable cookie) but maybe this is a bit of overkill. Does this make it clearer? |
Only if the language is detected by the browser, enforce the language shown to make the default URL deterministic for SEO. Otherwise, allow the option "Hide URL language information for default language". Note the "x-default" item is not concerned by these changes, this link always uses the default URL with no override.
@antonzol i have now pushed a new change to fix the problem raised in #198 (very old ticket). Description of the fix: I have updated the Wiki with all these clarifications about the redirections especially with a new clear section for the SEO and hreflang. So in short: if you want the behavior you asked in first hand, simply disable the browser detection. This keeps all the hreflang consistent and it requires no change anymore. Possibly don't use the new filter |
@antonzol can we close this? |
@antonzol i prefer to close this for now with the information given in this thread. You can still comment on this issue if you feel something is not clear. |
@antonzol fix released in 3.9.0 when the browser detection is disabled. |
If flag Hide URL language information for default language is active - hreflang to default language anyway include lang-pach.
Changing qtranxf_convertURL to defalult false - fix this problem