Question

404 Error Suddenly Appearing for www URL but non-www still working

This site, degrandchamps.com, has been up and running for a couple years now. Suddenly about two weeks ago the www URL quit working. When trying to access the site using www it returns a 404 error. I have researched and tried so many things I can’t even begin to start at what I have tried. I am getting pretty desperate as this client is quite frustrated. There were two errors at first. The one I corrected was that the www suddenly started returning that it wasn’t secured. I fixed that by reinstalling certbot and the certificates. This is a Wordpress site on Ubuntu 16.04 with Apache 2 installed.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello,

I believe that you either have two separate Apache Vhosts, one for your www version and one for the non-www version with different document root directories.

If this is the case what you need to do is:

  • Remove your duplicated www virtual host
  • Add your www version to your main vhost under the server alias section
  • Re-issue Let’s Encrypt for both www and the non www version so that the SSL certificate includes both

Let me know how it goes!

If this is not the case, you could share your Apache Vhost for your domain here so that I could advise you further.

Regards, Bobby