> For the complete documentation index, see [llms.txt](https://docs.rafflex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rafflex.io/helpful-info/ensure-www.-loads-your-site.md).

# Ensure [www](http://www). Loads Your Site

Your Rafflex site lives at your main domain (for example yourrafflesite.com). Follow these steps in Cloudflare so that anyone who types www\.yourrafflesite.com is sent straight to your site too.

***

Your Rafflex site runs on your main domain, without the `www.` at the front (for example `yourrafflesite.com`). Lots of people still type `www.` out of habit, though, and if nothing is set up for it they will see an error instead of your site.

This guide fixes that in three quick steps, all done in your Cloudflare account:

1. Add a **www** record so Cloudflare knows about the www version of your domain.
2. Add a redirect so anyone visiting `www.yourrafflesite.com` is sent to `yourrafflesite.com`.
3. Make sure every visitor is sent to the secure (**https**) version of your site.

It takes about five minutes, and you do not need to change anything in your Rafflex admin panel.

{% hint style="warning" %}
If you have not connected your domain yet, start with [Add Your Domain to RaffleX](/getting-started/add-your-domain-to-rafflex.md). Come back here once your site is loading on your main domain.
{% endhint %}

{% hint style="info" %}
**What is a redirect?** A redirect is an automatic forward. When someone visits one address, their browser is instantly sent on to another. Your visitors will not notice it happening; they will simply land on your site.
{% endhint %}

***

### Step 1: Add a CNAME record for www

A CNAME record is a type of DNS record that says "this name should point to the same place as that one". Here, you are pointing `www` at Rafflex.

1. **Log in** to your **Cloudflare** account.
2. **Click** on your domain name (for example **yourrafflesite.com**).
3. **Click** on **DNS** in the left hand menu, then **Records**.
4. Click **Add record**.
5. Under **Type**, select **CNAME**.
6. In **Name**, type **www**.
7. In **Target**, enter **customers.rafflex.io**.
8. Make sure **Proxy status** is switched on (the cloud icon is orange and says **Proxied**).
9. **Click** **Save**.

<figure><img src="https://1199660663-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8qKq7FrwgsgVkUWodGm%2Fuploads%2FZTbsgIlvDBCmoAzzFNcr%2Fimage.png?alt=media&amp;token=08da8fc9-5617-45c0-a2aa-b4c8ca215070" alt="Adding a CNAME record named www with the target customers.rafflex.io in Cloudflare"><figcaption></figcaption></figure>

{% hint style="warning" %}
**Cloudflare says a record with that name already exists?** Look through your DNS list for an existing record with the name **www**. Old domain providers often leave one behind, for example a CNAME pointing to `yourrafflesite.com` or an A record pointing to a "parked" page. Click **Edit** on that record and change it to match the steps above, or delete it and add the new one.
{% endhint %}

{% hint style="info" %}
`customers.rafflex.io` is the same value your main domain points to. It is included in the DNS records you imported when you followed [Add Your Domain to RaffleX](/getting-started/add-your-domain-to-rafflex.md), so you can check it against the record for your main domain in your Cloudflare DNS list.
{% endhint %}

***

### Step 2: Redirect www to your main domain

Now set up a rule that sends visitors from **[www.yourrafflesite.com](http://www.yourrafflesite.com)** to **yourrafflesite.com**. Cloudflare has a ready made template for this, so you do not need to type anything.

1. In Cloudflare, with your domain still open, **click** on **Rules** in the left hand menu.
2. You will see a list of templates. **Select "Redirect from WWW to Root"**.
3. No need to change anything. Click **Deploy**.

<figure><img src="https://1199660663-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fr8qKq7FrwgsgVkUWodGm%2Fuploads%2FrP5zIFaJMcf2m7xMUzKN%2FSCR-20250318-kbtk.png?alt=media&amp;token=159bb28c-ce8f-44b9-a5d2-3ecb60600683" alt="The Redirect from WWW to Root template in Cloudflare Rules"><figcaption></figcaption></figure>

{% hint style="warning" %}
Make sure you pick **Redirect from WWW to Root**, not the similar looking **Redirect from Root to WWW**. The root (your domain without www) is where your Rafflex site lives, so that is where visitors need to end up. Choosing the wrong one would stop your site from loading.
{% endhint %}

The template keeps the rest of the address intact. So if someone follows a link to `www.yourrafflesite.com/some-page`, they land on `yourrafflesite.com/some-page`, not just your homepage.

***

### Step 3: Make sure HTTPS is always used

To make sure all traffic is secure and loads correctly, set up an **HTTP to HTTPS** redirect. This sends anyone who visits the insecure `http://` version of your site to the secure `https://` version, the one with the padlock. It also makes sure the www redirect from Step 2 works no matter how the address was typed.

1. Go back to **Rules**.
2. Find the **"Redirect from HTTP to HTTPS"** template.
3. Click **Deploy**.

{% hint style="info" %}
**Cannot see that template?** Cloudflare sometimes changes its menus. You can get the same result another way: in Cloudflare, click **SSL/TLS** in the left hand menu, then **Edge Certificates**, and switch on **Always Use HTTPS**.
{% endhint %}

***

### Check it works

Give Cloudflare a few minutes to apply your changes, then test each version of your address. It is best to use a private or incognito browser window, so your browser does not show you an older saved copy.

| Type this into your browser     | You should end up on                     |
| ------------------------------- | ---------------------------------------- |
| `www.yourrafflesite.com`        | `https://yourrafflesite.com`             |
| `http://www.yourrafflesite.com` | `https://yourrafflesite.com`             |
| `http://yourrafflesite.com`     | `https://yourrafflesite.com`             |
| `https://yourrafflesite.com`    | `https://yourrafflesite.com` (no change) |

That's it! Your **www** address now forwards to your main site, and all traffic is securely routed through HTTPS.

{% hint style="warning" %}
**Still not working?**

* Wait a little longer. DNS changes are usually quick, but can occasionally take up to an hour.
* Check the **www** record in Step 1 has **Proxy status** switched on. The redirect rules only work on records that are proxied (orange cloud).
* Check you chose **Redirect from WWW to Root** in Step 2, not the other way round.

If you are still stuck, [drop us a message](https://rafflex.io/contact-us) with a screenshot of your Cloudflare DNS records and your Rules page, and we will help you sort it.
{% endhint %}

{% content-ref url="/pages/E5LUHnMY87zEXcP4rBEc" %}
[2️⃣ Add Your Domain to RaffleX](/getting-started/add-your-domain-to-rafflex.md)
{% endcontent-ref %}
