GoDaddy托管WordPress首页自动跳转至陌生页面问题求助
Fixing Homepage-Only Malicious Redirect on GoDaddy WordPress Site
Hey there, sorry to hear you're stuck with this frustrating redirect issue on your WordPress site! Since only your homepage is redirecting to that sketchy link while other pages work fine, we can narrow down the troubleshooting steps pretty effectively. Let's walk through them one by one:
1. Check WordPress Homepage Settings First
- Head to your WordPress dashboard → Settings > Reading. Double-check the "Your homepage displays" section—make sure it's set to either your latest posts or a legitimate static page, not some unknown entry.
- Go to Appearance > Customize > Homepage Template (or similar, depending on your theme). Look for any custom HTML/JS code snippets added here—malicious redirects often hide in custom homepage scripts.
2. Inspect Your Theme's Homepage Template Files
- Use FTP or GoDaddy's built-in File Manager to access your site's files. Navigate to
wp-content/themes/[your-active-theme]/and look forfront-page.phporhome.php(these are the common templates for the homepage). - Open these files and scan for suspicious code:
- Any unexpected
header("Location: ...")functions pointing to the malicious URL - Base64-encoded strings (they look like random letters/numbers) that might decode to redirect logic
- Any unexpected
- Also check your theme's
functions.phpfile—some attackers inject code here that triggers only on the homepage.
3. Verify Database Options for Tampering
- Access your site's database via phpMyAdmin (available in GoDaddy's hosting control panel).
- Find the
wp_optionstable (your table prefix might be different if you changed it). Search for thehomeandsiteurloptions—ensure their values are set correctly to your domain with no extra characters or redirect URLs. - Do a broader search in the
wp_optionstable for terms like "redirect" or "url" to spot any malicious custom options added by attackers.
4. Rule Out Plugin Issues
- Temporarily disable all WordPress plugins. If the homepage stops redirecting, you know one of the plugins is the culprit.
- Re-enable plugins one by one, checking the homepage after each enablement, to identify which plugin is causing the problem. Pay extra attention to recently installed/updated plugins, or any less reputable ones you might have added.
5. Recheck Your .htaccess File (Thoroughly)
- First, make a backup of your current
.htaccessfile in case you need to revert. - Replace the content with the default WordPress .htaccess 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 - Set the file permissions for
.htaccessto644to prevent unauthorized modifications in the future.
6. Run a Malware Scan
- Use GoDaddy's built-in website security scanner (found in your hosting dashboard) to run a full site scan—this can detect hidden malicious files or injected code you might have missed.
- If you can install plugins safely, use a reputable security plugin like Wordfence to perform a deep scan of your site files and database.
If none of these steps resolve the issue, reach out to GoDaddy's support team—they can help check for server-level redirects or other hosting-related issues that might be causing the problem.
内容的提问来源于stack exchange,提问作者Pattatharasu Nataraj
相关产品推荐
相关产品推荐

