.htaccess file disappears from htdocs folder after editing

Website URL

https://bigweirddeck.page.gd/

Other Information

I was trying to update my .htaccess file to include Cloudflare IP ranges (to see if that would address a recurring issue with entry process limits) and after I clicked “Save & Close”, it disappeared so now my site is returning 404 errors on every page except for the main one.

I tried to recreate it by copying the .htaccess file from the parent folder into /htdocs and then adding the few lines for basic Wordpress support. When I saved the edit, again it disappeared. Since the original copy is only ~500 bytes this does not seem to be a file size issue, which was the only explanation I could find in other posts.

For the .htaccess issue, it’s recommended that you create the file locally then upload it via FTP instead of using the file manager which can be buggy.

For your actual issue, no, the entry process limit is unrelated to .htaccess and is not something you can bypass like that.

Thanks. And there’s no way to recover the .access file that was there earlier, is there?

If it’s actually deleted then I don’t think there’s a way to recover it. There’re no server level backups available on free hosting.

Files that are too big are automatically deleted. And the maximum file size for .htaccess files is 10 kB.

You should just be able to create a new .htaccess file with the default WordPress rules. There is no need to copy the default files from the parent folder: .htaccess rules from parent folders are applied to all subfolders unless the subfolder has .htaccess rules overriding them.

Also, I’m not sure why you need Cloudflare IP ranges in your .htaccess file. Cloudflare real IP mapping is done automatically on our hosting.

Thanks. I’ll try recreating the file with just the WP rules and see if it works. :crossed_fingers:

The IP mapping was suggested on someone’s post as a solution in case the original IP address for my domain was cached somewhere, but I don’t think that’s the issue after all since I can now see the offending traffic in my Cloudflare stats so it must be getting routed thru them already. Going to try some of their bot-blocking settings next, since this looks like a recurring monthly spike from a crawler or something.

Not the best long term solution but in cloudflare you can enable “I’m under attack” mode that will stop most bots. It will give legitimate visitors a verification screen. But might help

Were you trying to add the IP ranges to block non-Cloudflare traffic? Because that won’t work, precisely because we already remap the source IP on the server. That results in your .htaccess rules not seeing Cloudflare’s IPs, but only the IPs that Cloudflare forwards.

There is no way to block non-Cloudflare traffic on our hosting right now.