WordPress.org

Ready to get started?Download WordPress

Forums

Language Redirect
Simple and solves my need (1 post)

5 stars
  1. openmtl
    Member
    Posted 7 months ago #

    I have a multisite with a / (root) for the english and /fr/ and /it/ for french and italian. There is no real overlap in posts - the page and menus are completely different. Yes I should of have a root and then /en/ for english but the client wanted a default on the root.

    I wanted french browsers to redirect but if they then clicked the english (root) site then they would...redirect back to the French site with this language-redirect 1.0.0 plugin. I did not want that I wanted them to be able to browse around anywhere on our root or subsites.

    So I patched the code and added a feature that sets a cookie if the root is visited and the redirect fires. Once that has done once then the cookie is checked and the redirect is not done again. Thus with my patch a french browser would hit the root and redirect once but then they can go to the root and not get redirected. cookie lifetime is 28 days.

    See the github for the changes.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.