Redirect Old to New Domain with HTTPS without Web Hosting for Free (with Cloudflare) - Nerdizen

Redirect Old to New Domain with HTTPS without Web Hosting for Free (with Cloudflare)

Redirect Old to New Domain with HTTPS without Web Hosting for Free (with Cloudflare)

Got a new domain name for our website and want to redirect the old domain to the new one, but we don't have web hosting for the SSL/HTTPS? Easy, we can use the free service Cloudflare provided.


Nerdizen.xyz — Redirecting domain is of course can be done easily on our domain's registrar platform from the provided tools there e.g., the DNS settings.

But what if we want to also redirect the SSL/HTTPS version of our website, but we don't have way to setup it because we don't have a web hosting? Cloudflare is the solution!

Article featured image

If we park our domain on Cloudflare, it provides the SSL encryption to secure the connection using the HTTPS protocol, so redirecting HTTPS is working without a hassle.

Moreover, Cloudflare is generous enough, even the free plan is great and SSL/HTTPS connection is available on their free plan.

Steps redirecting a domain to another one with SSL/HTTPS on Cloudflare

Changing nameservers, parking old domain to Cloudflare and enabling the HTTPS connection

  1. Log in to the Cloudflare's dashboard and add our domain/website.
  2. When selecting the plan, choose suit us. Of course here I will be using the Free plan. 😋
    Image for step 2
  3. It will ask to change the nameservers to the one Cloudflare's provided.
  4. Go to our original domain's registrar, for example here I am using Namecheap, and set the custom nameservers to the one Cloudflare provides, example for me:

    - kami.ns.cloudflare.com
    - paul.ns.cloudflare.com

    Image for step 3 & 4, 1 Image for step 3 & 4, 2
  5. Wait. Nameserver changes often won't take instantly and can take up to 48 hours. We can check back every 30 minutes and refresh the Cloudflare domain/website page to see if the status is changed to "Active".
  6. After the status is changed to "Active", delete unused DNS records. Click the "DNS" menu on the sidebar, it will take us to the "Records" sub menu.
  7. Scroll down and delete all records with "A" or "CNAME" Type column that has Name column of our domain's root or www. Click "Edit" on the Action column of the record, then click "Delete" button on the bottom.
    Image for step 7
  8. Next enabling the HTTPS connection, click the "SSL/TLS" menu on the sidebar, and set the mode to "Flexible".
    Image for step 8
  9. Back to the DNS menu, we'll add Cloudflare's DNS records to our domain. Click "Add record", then add two new A records:

    a.) Type: A | Name: @ | IPv4 adress: 192.0.2.1 | Proxy status: enabled.
    b.) Type: A | Name: www | IPv4 adress: 192.0.2.1 | Proxy status: enabled.

    Click "Save" on the button to save the each new records.
    Image for step 9, 1 Image for step 9, 2

Redirect naked/root domain

  1. Expand the "Rules" menu on the sidebar by clicking the arrow icon → "Redirect Rules" → Click "Create rule" button.
  2. On the "Rule name" input, create a descriptive name, e.g., Redirect to www.mynewdomain.com.
  3. Scroll down to the "When incoming requests match..." section and fill the fields, example:

    a.) Field: Hostname
    b.) Operator: equals
    c.) Value: mycurrentdomain.com
  4. Scroll down to "Then..." section and fill the fields:

    a.) Type: Dynamic
    b.) Expression: concat("https://mynewdomain.com", http.request.uri.path)
    c.) Status code: 301
    d.) Tick the "Preserve query string".
  5. Click "Deploy" button on the bottom right.
    Image for step 1 to 5

Redirect www version and other subdomain

  1. Go to "Redirect Rules" sub menu under the "Rules" menu on the sidebar (still on the same menu from the previous steps).
  2. Scroll down to "Bulk Redirects" section and click "create a bulk redirect list".
    Image for step 2
  3. On the Name input, type desired name, it can only contain letters and underscores, e.g., www_currentdomain_com_to_newdomain_com, click "Next".

    Image for step 3
  4. On the "Add URLs to redirect" section, click "Or, manually add URL redirects", it will pops out the record fields and fill it, example:

    a.) Source URL: www.currentdomain.com
    b.) Target URL: www.newdomain.com
    c.) Status: 301
  5. Click the "Edit parameters" to show additional settings and tick it all:

    - Preserve query strings
    - Include subdomains
    - Subpath matching
    - Preserve path suffix

    Image for step 4 & 5
  6. Click "Next" on the bottom, → "Next" again on the Review and edit URL redirects, → "Continue to Redirect Rules".
  7. Give a descriptive name on the Rule name input, e.g., www.currentdomain.com to newdomain.com, click "Save and Deploy".
    Image for step 7

That's conclude our tutorial how to redirect our old domain with its HTTPS version to new domain without web hosting using Cloudflare, for free.

Don't forget to test the redirection using a new private window to bypass browser's cache or use fresh browser that haven't visited our old domain before.

Redirect Old Domain to New Domain with SSL/HTTPS without Web Host, Free with Cloudflare video on YouTube


Emoticon Emoticon

Formulir Kontak