fastly/fastly-magento2

GeoIP redirect URL contains both target and current store codes

Closed this issue · 5 comments

I enabled Fastly GeoIP on my cloud instance.
I added country to store view mapping.
Add store code to Urls configuration is enabled.
When customer is redirected to a target sotre the URL contains both current and target store codes.
Instead of redirecting from https://somedomain.com/de to https://somedomain.com/en it redirects to https://somedomain.com/en/de

@bbutkovic @dpotkoc I thought we addressed this with #569. Can you investigate.

@bbutkovic @dpotkoc I thought we addressed this with #569. Can you investigate.

We are looking into this.

Hello, @mykolaoleksiuk, thank you for reporting this issue with us.

Unfortunately, we were unable to reproduce the issue, could you just check a couple of things for us to help us get to the bottom of this?

  • The version of Fastly Cdn module used
  • Magento 2 version
  • You have Add Store Code to Urls enabled
  • Your Default Config base URLs are set to https://somedomain.com (both for secure and non-secure). We're using somedomain.com as an example here.
  • The base URLs for de and en stores are configured to either use default or use website.

In the case that the base URLs for de or en stores are not use default or use website, we'd like to ask you to let us know of any overrides to the base URLs that you have applied to store/website config.

It could also be helpful to see your GeoIP redirection config.

One potential cause for this could be that your Magento 2 instance is configured to a different base URL for either the en or de stores and they resemble something along the lines of https://somedomain.com/en or https://somedomain.com/de

Hello @bbutkovic,

We spent some more time investigating the issue and found out that it was caused by a third-party plugin for Magento\Store\Model\Store::isUseStoreInUrl().
Sorry for bothering you and thank you for help.

@mykolaoleksiuk glad you got it fixed and you're welcome :)

Despite the issue not being related to us, I took the opportunity to add some tests for the URL rewrite logic in our Magento module that tests against various different configuration and URL variations. We can close this issue but I'll add the test cases for future reference.

cc: @vvuksan