Coder Social home page Coder Social logo

Comments (9)

rubyconvict avatar rubyconvict commented on July 18, 2024

Hi, this leads to duplicate content, IMHO - a bad idea. Take this article for example: http://www.hobo-web.co.uk/duplicate-content-problems/

from routing-filter.

kennyadsl avatar kennyadsl commented on July 18, 2024

@rubyconvict you are totally right! I didn't considered this aspect. Do you have any other idea about how to implement this? Or do you think it's not doable at all?

from routing-filter.

simi avatar simi commented on July 18, 2024

What's the usecase for this?

from routing-filter.

kennyadsl avatar kennyadsl commented on July 18, 2024

@simi users could type website paths using both locale segments:

  • website.com/zh-CN
  • website.com/zh-cn

The last one (zh-cn), as it is now (or as I think it is 😄), will not be accepted as valid because it's not listed into I18n.available_locales.

We are looking for a valid solution to accept both versions setting the current locale to zh-CN, if possible.

from routing-filter.

simi avatar simi commented on July 18, 2024

Just redirect from website.com/zh-cn/* to zh-CN/*.

from routing-filter.

kennyadsl avatar kennyadsl commented on July 18, 2024

Well, redirecting was what I was trying to avoid since zh-CN is not the only possible locale with this issue and, being needed on a multidomain platform on which each domain can have multiple locales, it would require more maintenance work per domain/locale. I was trying to figure out if this can be made dynamic. Thanks anyway!

from routing-filter.

kennyadsl avatar kennyadsl commented on July 18, 2024

@simi p.s sorry for not pointing that out in the too simplified usecase I've presented!

from routing-filter.

rubyconvict avatar rubyconvict commented on July 18, 2024

301 redirect is the way to go for SEO, if locele is not in case sensitive I18n.available_locales, I would check downcased version against downcased array of locales and redirect based on mapping from downcased match, eg. {"zh-cn" => "zh-CN"}. Indeed, this would be cool opt-in feature for this gem.

from routing-filter.

kennyadsl avatar kennyadsl commented on July 18, 2024

@rubyconvict yes, that would be great and solve our usecase. Just wondering if and how is possible to make redirects from inside a routing filter. I can't see anything like that in other provided filters.

from routing-filter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.