Reproduction Steps
1. Environment Setup
-
Create two websites in Magento:
- AU Website (Australia)
- US Website (United States)
-
Set the AU website as the default store view
-
Configure Fastly GeoIP Country Mapping as documented here:
-
Add the following GeoIP mappings:
2. Product Configuration
- Create a product associated only with the US store
- Ensure the product is not available in the AU (default) store
3. Testing Procedure
- Open a new browser window
- Open browser Developer Tools with Preserve Log enabled to track redirects
- Connect to a VPN with a US IP address
- Access the product URL directly
Current Behavior (Actual)
The system returns the following sequence of responses:
- First Response:
HTTP 404 Not Found (from Default Store View - AU)
- Second Response:
HTTP 302 Found (via /stores/store/switch/)
- Final Response:
HTTP 200 OK (from US store)
Problem: The 404 status code is returned before the GeoIP redirect occurs, causing SEO problems as search engine crawlers index the 404 error, potentially de-indexing the product.
Expected Behavior
The system should perform an Edge-side redirect (301 or 302) directly to the correct store view based on GeoIP, without:
- Hitting the Default Store View's routing table
- Returning a 404 status code
Users and crawlers should be redirected seamlessly to the appropriate store view, and products should remain properly indexed.
Live Example
Test URL: https://store.zyxel.com/atp700-us0102f.html
Instructions:
- Access this URL using a US VPN IP address
- Keep browser Developer Tools open to observe the network requests
- Note the initial 404 response before the redirect
Screen Recording: View recording
Reproduction Steps
1. Environment Setup
Create two websites in Magento:
Set the AU website as the default store view
Configure Fastly GeoIP Country Mapping as documented here:
Add the following GeoIP mappings:
2. Product Configuration
3. Testing Procedure
Current Behavior (Actual)
The system returns the following sequence of responses:
HTTP 404 Not Found(from Default Store View - AU)HTTP 302 Found(via/stores/store/switch/)HTTP 200 OK(from US store)Problem: The 404 status code is returned before the GeoIP redirect occurs, causing SEO problems as search engine crawlers index the 404 error, potentially de-indexing the product.
Expected Behavior
The system should perform an Edge-side redirect (301 or 302) directly to the correct store view based on GeoIP, without:
Users and crawlers should be redirected seamlessly to the appropriate store view, and products should remain properly indexed.
Live Example
Test URL: https://store.zyxel.com/atp700-us0102f.html
Instructions:
Screen Recording: View recording