How can I password protect a subdomain

Sorry for the lack of category. I’m not sure how to categorize this and didn’t want to put it in a section where it doesn’t belong.

I’m not an IT guy, so I’m struggling here. Apologies in advance.

I have a main domain for our public-facing website (domain-dot-com), and a sub-domain for an internal website (techinfo.domain-dot-com). The subdomain was password protected when our DNS was handled by our hosting company. When DNS was moved to Cloudflare, the sub-domain wasn’t moved with the main domain.

I was able to add it by creating a DNS entry “A” / techinfo.domain-dot-com / IP address and it worked, but it wasn’t password protected and anyone on the internet could read it, so I removed the DNS entry.

How do I add password protection to a subdomain?

You can either password protect it at the origin. Some people use an .htaccess file (Google this for info). Or you can use “Access” which is pretty much the only Cloudflare feature that does this. I use an Access “Bypass” for my IP address/range, then “Allow” for email address(es) when I’m off my local network.

Thanks for the reply! I’ll Google .htaccess and see if I can figure out how to implement it.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.