Published on 11/14/2024

How We Fixed a 404 Error on a Client’s Website

How We Fixed a 404 Error on a Client’s Website

When a website shows a 404 Page Not Found error, it can cause panic, especially when visitors can’t access the site. Recently, a client came to us with this issue. Their website was hosted on GoDaddy, but the domain was managed through Squarespace. The website had stopped working, and they couldn’t log in to fix it.

Step 1: Checking the .htaccess File

One of the first things we checked was the .htaccess file. Below is the default WordPress .htaccess code that we used to reset the configuration:

[sourcecode language=”apache”]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
[/sourcecode]

Step 2: Using nslookup to Check DNS

Next, we used nslookup to verify the domain’s DNS settings. The results showed that the domain was pointing to the wrong IP address, which was the cause of the 404 error. Here’s the command we used:

[sourcecode language=”bash”]
nslookup example.com
[/sourcecode]

The output showed a mismatched IP address, so we corrected it in the DNS settings.

Step 3: Fixing the DNS Records

We logged into the domain manager (Squarespace) and updated the DNS records:

[sourcecode language=”yaml”]
@ A Correct_Server_IP
www A Correct_Server_IP
@ TXT google-site-verification=verification-code
[/sourcecode]

After saving the changes, the site was back online within a few minutes.

Conclusion

Fixing a 404 error can be tricky, but following a methodical approach helps. If you’re facing similar issues, start by checking your server setup and DNS records. Need help? Contact us for expert website troubleshooting.

Leave a Comment

Comments (0)

No comments yet. Be the first to comment!