Skip to content
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

Prefix urls with the language to improve SEO #133

Closed
stanislas-m opened this issue Jan 14, 2018 · 5 comments
Closed

Prefix urls with the language to improve SEO #133

stanislas-m opened this issue Jan 14, 2018 · 5 comments
Assignees

Comments

@stanislas-m
Copy link
Member

The docs are only indexed in english. To improve the SEO, it can be a good thing to have different URLs for the french and future versions.

For instance, https://gobuffalo.io/docs/new-project can still be the english (default) version, and the french version will be https://gobuffalo.io/fr/docs/new-project

@hubyhuby
Copy link

hubyhuby commented Mar 3, 2018

I plan to use translation later with buffalo, and this type of urls is compulsory for SEO.
Other url type that google like aswell are fr.gobuffalo.io, es.gobuffalo.io ...
Related question: Could this mechanisme of subfolder language be automated in a way with the buffalo generator ? As it is a standard url scheme for websites.

@stanislas-m
Copy link
Member Author

@hubyhuby I plan to change the i18n middleware a bit, to allow customized extractors for the language:

  • Cookie
  • Session
  • URL param, maybe (?lang=en)
  • URL prefix (/en/, /fr/)
  • subdomains (en.domain.io, fr.domain.io)
  • Custom extractor using an interface?

I'd like to have a way to set priority for extractors too (first session, then cookie, and so on). Keeping the same default as now should be enough to keep back-compatibility.

@hubyhuby
Copy link

hubyhuby commented Mar 7, 2018

Hi @stanislas-m ,
I have not experienced for now the i18n feature in Buffalo.
On a SEO perspective what I have read is that the best practices in order are :
-Have several top domains : gobuffalo.fr gobuffalo.de ...
-Have subdomain like this fr.gobuffalo.io de.gobuffalo.fr ....
-Have a subfolder gobuffalo.io/fr gobuffalo.io/de

As I understand the "?lang=en" is not something search engines like. As of today...

My personal experience with the last website launch 4 motnhs ago, is that subdomains like "en.gobuffalo.io" works well in google. If I am in spain and try to reach my french website it will show on google "en.gobuffalo.io" (and not "gobuffalo.io" ) in first page. (I don t have a spanish website so it defaults to EN)

Conerning your technical question, as I didn t used it yet, I don t have a vlue ;)

@stanislas-m
Copy link
Member Author

stanislas-m commented Mar 7, 2018

@hubyhuby I've reworked the i18n middleware a bit here: gobuffalo/buffalo#957 (and here is the way to use the new URL prefix language finder: https://github.com/gobuffalo/buffalo/blob/ef75e1dfa8c2bec86ad07aea7ca2f5b2feb5acca/middleware/i18n/i18n_test.go#L33)

It should allow to manage the subfolder way, and make the language finding easier to extend. I'm not sure Buffalo allows to run multiple domains / subdomains from now, but if not you can ask for this feature in the Buffalo repo. :)

@stanislas-m
Copy link
Member Author

Since this specific point is resolved, I close this issue. @hubyhuby if you want a support for subdomains, please add an issue in the buffalo repo. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants