Hostxpeed
Login Get Started →
Troubleshooting

Fix Website "404 Not Found"

5 min read
28 views
Jun 10, 2026

Understanding 404 Errors

The requested resource doesn't exist on the server.

Fix 1: Check File Exists

ls -la /var/www/your-site/path/to/requested/file

Fix 2: Check Nginx Try Files Directive

# Common WordPress configuration
location / {
    try_files $uri $uri/ /index.php?$args;
}

If misconfigured, fix and reload:

sudo nginx -t
sudo systemctl reload nginx

Fix 3: Check Apache mod_rewrite

sudo a2enmod rewrite
sudo systemctl restart apache2

Ensure .htaccess is allowed:

# In Apache config
AllowOverride All

Fix 4: WordPress Permalinks

Regenerate .htaccess:

# Via WP admin > Settings > Permalinks > Save Changes

# Or recreate .htaccess manually
echo "# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress" > /var/www/wordpress/.htaccess

Fix 5: Check Case Sensitivity

Linux filenames are case-sensitive:

# About.jpg vs about.jpg - different files!

Fix 6: Check Symbolic Links

# Ensure follow symlinks is allowed
# Nginx: disable_symlinks off;
# Apache: Options +FollowSymLinks

Fix 7: Verify Server Root

# Nginx
grep root /etc/nginx/sites-available/your-site

# Apache
grep DocumentRoot /etc/apache2/sites-available/your-site.conf

Was this article helpful?