Best way to do 301 redirect on subdomain

I have a subdomain that I want to setup a 301 redirect to the main domain. I want that domain to go to …Page rules do not work…I have tried everything, using proxy and all. Nothing seems to work. Can someone please help me?

Can you give the domain and subdomain?

yes action.nolabels. org and I want it to forward to nolabels. org currently CNAMEs to Cloudfront at

You want to replace that? If so, you will need to delete the CNAME record, add an A record pointing to action (make sure it is proxied), then your redirect should work if it’s correctly set up.

Redirecting it to will then redirect again to (CNAMEs to, is that your aim?

1 Like

I just want when people to go to action. nolabels. org to get a 301 redirect to the main nolabels. org…how can I do that…page rules was not working :frowning:

Then do what I suggested.

Delete the existing CNAME and add an A record for action pointing to and ensure it is proxied.

(The current CNAME is not proxied and so the request doesn’t reach Cloudflare so the redirect can never happen).

Assuming the redirect is set up correctly, it should then happen.

1 Like

just did that and I get the “your site cannot be found” error

Working OK for me. Page loads in a browser and redirects happen…

curl -I
**HTTP/2 301**
date: Mon, 13 Nov 2023 21:06:04 GMT
cache-control: max-age=3600
expires: Mon, 13 Nov 2023 22:06:04 GMT
report-to: {"endpoints":[{"url":"https:\/\/\/report\/v3?s=pr4pctyO6uy3R9E0QSpB0B8BYRWOxcwPj6d8awiSD8KrvtglZUr7HPegWwFslt8Uv%2F%2Fro7GtyV3x%2F1l1coYV4qvO4LCGFaIoo%2BU%2FXRMlErVHDDQ%2FxkyNmhxZ%2FDPCl1UEK0Sgw3dA"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 8259f9fb2ddb6401-LHR
alt-svc: h3=":443"; ma=86400

curl -I
**HTTP/1.1 301 Moved Permanently**
Server: openresty
Date: Mon, 13 Nov 2023 21:06:16 GMT
Content-Type: text/html
Content-Length: 166
Connection: keep-alive

curl -I
**HTTP/2 200**
server: nginx
content-type: text/html; charset=utf-8
cache-control: public, max-age=0
cache-tag: long_cache_articles/25318866,section/2224365851,section/0-25318866,section/588372768,section/2235420434
cloudflare-cdn-cache-control: max-age=3700, stale-while-revalidate=2592000, stale-if-error=87600
etag: "cad92212445b579c34a5b0c7165c44fa"
1 Like

You haven’t yet changed the DNS records as suggested by @sjr, right? You’ll need to do that, and make sure your subdomain A record is :orange: proxied. Then you’ll need to wait until the DNS change fully propagates. DNS Checker - DNS Check Propagation Tool

1 Like

Ok i did all of this…officially made the changes…waited about 30 mins…still not working…can you all see on your end if it looks good?

Works fine for me. Page is OK in browser and redirects are working…

Connecting to for
Received HTTP redirect code 301, absolute redirect to
Connecting to
Received HTTP redirect code 301, absolute redirect to
Connecting to
Connected with HTTP code 200.

I use the url https:// action . nolabels. org and it fails?

ok I keep testing, sometimes it loads properly, sometimes it does not?

Note that only is proxied through Cloudflare, and are not so maybe there’s something on those origin handled requests that are blocking you.

dig +short

dig +short

dig +short

Does going to work for you?
Does going to work for you?

Hi…the A records for nolabels .org are both in cloudflare…but are not proxied…I can go to nolabels .org and go to www . nolabels .org and they both work…any advice?

Check you haven’t added any WAF rules that are blocking yourself, although you would expect a page to be shown for that so unlikely.

can anyone help? this is not working properly…I cant seem to figure this out