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

Can't get geomate.php custom config to work #1

Closed
jayhlee opened this issue Sep 25, 2018 · 1 comment
Closed

Can't get geomate.php custom config to work #1

jayhlee opened this issue Sep 25, 2018 · 1 comment

Comments

@jayhlee
Copy link

jayhlee commented Sep 25, 2018

I can't seem to get GeoMate to work in my setup. For my site, I'm using craft3-multi-environment configurations. I've successfully downloaded GeoMate and downloaded the geolocation database, but none of the GeoMate variables are working. (e.g. craft.geomate.country, craft.geomate.countryCode).

Based on the docs, I have a feeling the source of the issue is the geomate.php config file I created and added to the Craft config folder. I have the following configs, but it doesn't seem to take. In fact, the config settings just show up at the top of my web pages above my _layout.twig.

'forceIp' => 'IP-NUMBER-HERE',

'autoRedirectEnabled' => true,

'redirectMap' => [
    'korean' => 'ko',
    'global' => '*'
]

I'm pretty sure this is a user error on my end. But just in case, I was thinking it could possibly be an issue with the craft3-multi-environment set up I have. Any guidance would be greatly appreciated. Thanks much!

@aelvan
Copy link
Contributor

aelvan commented Oct 3, 2018

Sounds like you didn't create the config file correctly. It's suppose to be a php file that returns an array, either with the config settings as keys, or with the config settings nested inside keys for environment. So, something like:

<?php

return [
    '*' => [
        'forceIp' => 'IP-NUMBER-HERE',

        'autoRedirectEnabled' => true,

        'redirectMap' => [
             'korean' => 'ko',
             'global' => '*'
        ]
    ]
];

Also note that if you're logged in as an admin, by default you won't be redirected. So either test in incognito mode, or toggle redirectIgnoreAdmins in your config.

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