Do not delete the public_html folder when re-uploading files: your site may return 404
If your files are in place but your domain returns 404 Not Found or shows a "certificate name mismatch" warning on HTTPS, the cause may be related to your site's publishing folder (public_html).
What is happening?
The web server is reloaded from time to time (for example when a new site or SSL is set up, and during weekly maintenance). If your public_html folder is missing or not accessible at the moment of the reload, the server cannot load that site. Even if the folder comes back later, the site can stay offline until the server is reloaded again. Symptoms: the server's generic 404 page over HTTP and a wrong certificate over HTTPS.
How to avoid it
- Do not delete or rename the
public_htmlfolder. Only replace the files inside it. - Upload your new site to another folder first, then move its contents into
public_htmlwhen the upload is finished. See our FTP guide for uploading. - Make a backup before making changes.
- Keep sensitive folders of your application such as
config,databaseandbackupoutsidepublic_html(one level above) and adjust the file paths accordingly (for examplerequire __DIR__ . '/../includes/file.php';). Do not move the publishing folder one level up, otherwise these folders become downloadable from the web.
If your site is already offline
Make sure your files are inside public_html and open a support ticket. Include your domain name and the error you see (404 or certificate warning); in this case the web server needs to be reloaded. If you see a PHP error on the site, see the guide on viewing the PHP error.
If you get stuck, open a support ticket.
Thanks for your feedback!