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

Is there a way to autoRedirectEnabled only on first time page load? #48

Open
mateostabio opened this issue May 11, 2022 · 2 comments
Open

Comments

@mateostabio
Copy link

mateostabio commented May 11, 2022

Hello, I have got GeoMate working now. I set it up like this.

      'autoRedirectEnabled' => 'true',

      'redirectMap' => [
         'usa_en' => [
            'country' => 'us'
         ],
         'canada_fr' => [ // matches 'fr-CA'
            'language' => 'fr',
            'languageRegion' => 'ca',
         ],
         'canada_en' => [ // matches 'en-CA'
             'language' => 'en',
             'languageRegion' => 'ca',
         ]
     ]

First, it only redirects if I am using a USA IP, but if I'm in Canada, it just doesn't redirect, is it possible to redirect a user if he is in Canada, and the browser language is set to French to be redirected to 'canada_fr' and if a user is Canada with browser language English, to be redirected to 'Canada_en'? What am I missing?

Second, if the user gets redirected to the US country site because he is traveling, but actually wants to go to Canadian site, is there a way to let the user click on Canada on the site, and 'autoRedirectEnabled' allows it? Or is there a way to have "autoRedirectEnabled" only for first-time visit, but then if the user selects a different country site language he is directed to that one instead?

Thank you.

@urani
Copy link

urani commented Mar 15, 2023

@mateostabio have you found a solution to this by any chance ?

@mateostabio
Copy link
Author

No @urani I did not figure out for the multi language in one country.
What I did find out was that autoRedirectEnabled was better off as "false" in our setup, as it was redirecting even if someone clicked on a link on google, instead of serving that user the page he clicked on, it would redirect to the country homepage, so we turned it off.

This is our redirect map for just Canada and USA english.

  'redirectMap' => [
     'usa_en' => [
        'country' => 'us'
     ],
     'canada_en' => [
        'country' => 'ca'
     ]
  ]

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