apache - 301 redirect loops within the same domain to different server
I'm not sure how to properly articulate this question, so thanks for your patience.
I'm migrating a website to a new server (Shopify). I have too many inbound links to use their built-in 301 solution because they don't support wildcard redirects. Setting up a secondary server to handle the redirects would work, but since the old domain and the new one are the same how do I prevent redirect loops?
old url: mystore.com?p=123&q=456&r=789 new url: mystore.com/products/some-meaningful-string
My redirect server:
[code to create the new url from mystore.com?p=123&q=456&r=789] header("HTTP/1.1 301 Moved Permanently"); header("Location: mystore.com/products/some-meaningful-string");
Is there a way to set up the dns so that the registrar thinks the domain is on the redirect server, and the redirect server points to Shopify? I am wondering if the technique CDNs use would help.
Thanks in advance.
It sucks that you cannot generate a simple sitemap of all your current (soon to be old) URLs. That is really your only sane choice, without deep diving into the crazy.
A simple loop and with one line of code, you generate a 301 redirect and Shopify kicks in appropriately and you lose no juice on the old URLs.
Are you sure you cannot just write a simple script to tease out a listing of all your old URLs and map them to new ones?
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.