Resolve 404 errors on pretty permalinks and image upload issues by resetting permalinks and ensuring correct .htaccess rules. Requires Apache mod_rewrite enabled. After adding this, go to Settings → Permalinks and click Save Changes to refresh rules.
# 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