Redirect to new ghost URL

I need to change the custom URL for a blog hosted on Ghost Pro - I’m changing from subdomain.olddomain.com to newdomain.com

DNS for both olddomain.com and newdomain.com are managed in Cloudflare.

So far I’ve set up the new domain and configured this as a custom URL in Ghost pro, and all works fine when I directly access the new URL.

I am now trying to redirect traffic from the old URL to the new one, so users with old links or bookmarks can still access the site.

I just can’t get this to work! Here’s what I’ve tried:

  • removed the CNAME record for subdomain.olddomain.com
  • created a redirect rule under olddomain.com, with these details:
    ** expression (http.host equals "subdomain.olddomain.com.")
    ** redirect type: static
    ** redirect URL: https://newdomain.com
    ** statuscode: 301
    ** Preserve query string: true (this is in an attempt to preserve deep links)

I found some online help that seems to suggest I should enable Cloudflare proxy on my A and CNAME records. However, Ghost docs say to use DNS only for Cloudflare DNS config, and the site does not load at all if Cloudflare proxy is enabled, so I guess that is the wrong way to go…

Maybe this request should actually go to Cloudflare? I’m posting it here too in case someone has found a way to make this work specifically for a Ghost Pro blog…

Thanks

It used to be that the easy way do URL redirections like this was through your DNS provider, as many providers support a non-standard “HTTP Redirection” record.

The problem in recent times has been that SSL/https has become standard. Probably URLS to your old blog used “https”, so you need to redirect “https://” URLs. I’m not sure if Cloudflare offers a free https redirection service. If so, I’d use that.

Otherwise… you might contact Ghost(Pro) support to see what the recommend. I’m sure you aren’t the first customer to want this!