Link to home
Start Free TrialLog in
Avatar of ProcJunk
ProcJunk

asked on

Staging / Production Magento subdomain redirect issue

I manage a Magento store. We recently launched a corporate version, and moved the domain from the Magento Store to a Wordpress site. Wordpress works great.

Magento has two environments, a live and a stage site. We created TWO new URLs and changed the live store URL from the base (non sub) to a sub, and also changed the staging to another sub.

The issue is the live sub is redirecting back to the staging sub. Here are the links:
Corporate (Wordpress): apothecaryproducts.com
Live store: https://store.apothecaryproducts.com (ONLY works when https:// is in front, otherwise http://store.apothecaryproducts.com redirects to...
Stage store: zstagestore.apothecaryproducts.com

I'm at a loss for whats going on. I think it might be resolvable by setting up another "store" for staging, but I'm confused why its resolving to stage. Also the IP address resolves to stage: 162.209.57.148
Avatar of David Favor
David Favor
Flag of United States of America image

Likely much better for your Magento staging to create something like https://dev.store.apothecaryproducts.com so your dev site is also covered by an SSL cert, so login credentials don't leak.

Then when you're ready to deploy, change https://dev.store.apothecaryproducts.com name to https://store.apothecaryproducts.com in your site config + change IP of https://store.apothecaryproducts.com to the https://dev.store.apothecaryproducts.com IP.

The simple way to handle this entire process is to use Ubuntu + LXD.

The run your dev + production sites in separate containers, each with their own IP.

Then to switch, you just swap the two container IPs, so you can always revert, if the new dev site deployment show up a major problem.

I do this consistently with my clients. Works like a charm.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.