404 Error on WordPress using Subdomain

I have a subdomain set at subdomain.example.com but I’m getting 404 error.

I have the hosting at Hostgator and my domain with Google. I have WP installed on my subdomain on Hostgator. I have my domain on Google pointed to Cloudflare nameservers. I’m still getting 404 error.

I tried setting the A record with the subdomain and then CNAME, neither work.
Is there a step I’m missing?

Did you make sure it worked with HTTPS before you proxied it with Cloudflare? You should set it to :grey: (DNS-Only) and then wait five minutes before testing it.

No I didn’t do that. I’m testing it now.

1 Like

So now my site is loading HTTP, not secure, but it’s still going directly to 404 page. Do you know if I was supposed to enter an A record instead of CNAME?

It’s whatever your host has it configured for. They should have your origin DNS records in your account over there that you could mimic over here.

Hi there if you can give us the domain in question it will be easier to help you. Considering that you get a 404 response tells me that the DNS is at least set correctly to a valid host and that is possible that the Webserver doesn’t have content for that hostname or is not correctly configured. I suggest looking at the folder structure on the your hosting provider. And verify the configuration of the DNS settings for the subdomain and check the folder that is set as the root for the sub domain.

I assume there are no redirects? It goes straight to a 404?

Hey publicarray, it goes straight to 404.

I had Hostgator support help me 2 days in a row and couldn’t figure it out. I’ve had different reps tell me different things. I tried with only an A record added, I tried with only a CNAME record, I tried with both.

Currently, I have only the A record added. the domain is speedyketoliving.preparingyourlaunch.com

How do I check the folder that is set as the root for the subdomain? I know WordPress is installed on it because if I turn off SSL on Cloudflare the subdomain starts working and I can log in. But then the main domain has redirect error.

Ok, thanks for the additional info. Forget about DNS and subdomains for a second. From what I can tell something is wrong with the Wordpress install, Maybe it is configured to only use http try to turn off Cloudflare https again to login and check in the general settings the Wordpress Address URL and Site URL use https.

There are 2 redirects for wp-admin.php: One to https (could be because of Cloudflare, if it is setup that way) and one to /404.html which is done on your webserver (e.g. check .htaccess) or by Wordpress.

PS. The default readme.html can be accessed but also not over https http://speedyketoliving.preparingyourlaunch.com/readme.html

Wow so today I woke up and the site wasn’t working at all, even with the workaround I found yesterday. Speak to someone at Hostgator today and it turned about being an issue with the Mojo Marketplace plugin. Disabled it and the site works

1 Like