I'll explain our situation first for context: We are a canadian based company, so our Geo-IP location is Canada.

When we first setup our website, we had it setup as www.website.COM , however recently we acquired and installed a Geo-IP extension that allowed us to use our www.website.CA domain for our Canadian customers. This causes us one problem, we keep needing to log into our admin page using .com, however once in awhile we need to login remotely (from a cell phone for example), and when we do we get forwarded to .ca and then the admin page doesn't load.

Is there a way to make our admin page work from BOTH .ca and .com domains? (both are on the same installation/server/etc).

  • You could try setting them up as separate websites. Magento handles this natively: devdocs.magento.com/guides/v2.1/config-guide/multi-site/… – versalle88 Apr 2 '17 at 19:31
  • I dont think you understood what I was asking. I already HAVE a website with multiple seperate website/store/store views within the same configuration. Its gaining access to the admin page from both that is the problem. – TheNorthern_Light Apr 3 '17 at 20:08

I am not sure how the geo ip is set up but you could try to disable it for admin route.

[EDIT] I'll try to guess the settings. You have Base URL (Stores > Configuration > General > Website) on default scope set to www.website.com. Store view or website for Canada has base url set to www.website.ca. If this is the case then you are redirected to a url that magento recognizes as associated with canada store view and therefore tries to load it. I would expect you should see 404 page or generated html for admin login but unable to login (as session in cookies would not be properly send). What you can try to do in this situation is to set base url in default config scope to *.ca domain. If all access to admin is from canada based users this should be enough until disabling admin route is prepared.

If this is not feasible then only server-based configuration is possible. It should be possible in nginx/apache to change request_uri when entering second url. Magento can only work with 1 domain for admin. As far as I know you cannot even use *.ca for unsecure url and *.com for secure as magento in admin always redirects to secure.

| improve this answer | |
  • I've tried this, however it seem that the exclusion isnt working for the admin url (I have a ticket open with the Geo-IP extension developer). I was just wondering if there was another way to support this situation. – TheNorthern_Light Apr 3 '17 at 20:10
  • @Spyrule I've extended the response. – Zefiryn Apr 3 '17 at 21:29
  • I might setup the nginx forwarding for now until the Geo-IP extension is fixed. – TheNorthern_Light Apr 4 '17 at 3:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.