Home/Threat Library/.htaccess Redirect Malware

Redirects

.htaccess Redirect Malware

Malicious rewrite rules redirect visitors or search engines before WordPress handles the request.

Highseverity
Redirectsthreat type
Manualrecommended review

Symptoms

These are common signs associated with this type of WordPress compromise. The exact behavior can vary by hosting setup, cache layer, plugins and how the attacker configured the payload.

  • Redirects happen before the page loads.
  • Changing WordPress themes/plugins does not fix the redirect.
  • Only certain referrers or user agents are affected.

Technical overview

.htaccess malware is usually written after hosting access, file manager compromise, FTP compromise or PHP backdoor execution.

Important: visible symptoms are rarely the whole incident. A safe recovery should identify both the payload and the persistence mechanism that allowed it to run.

Indicators of compromise

During investigation, these indicators are commonly reviewed. They do not prove compromise alone, but they help map scope and root cause.

Suspicious RewriteRule entries
Encoded redirect domains
User-agent conditional rules
Referrer-based redirects
Recently modified .htaccess

Investigation process

WP•FIX treats this as an incident, not a simple file deletion task. The review normally includes WordPress core integrity, theme and plugin files, uploads, database options, users, cron events, redirects, cache layers and the most likely entry point.

Recovery process

  • Create a safe recovery point before changing production data.
  • Remove malicious files, scripts, database payloads and persistence mechanisms.
  • Replace compromised components with clean versions where appropriate.
  • Review administrator users, credentials and access paths.
  • Harden the site and document the recovery path.

Prevention

Prevention depends on the root cause. Common controls include removing nulled components, updating vulnerable plugins, reducing administrator access, hardening login paths, adding monitoring and keeping verified backups.

FAQ

Can this be cleaned with a plugin?

A plugin can help detect common indicators, but serious WordPress incidents need manual review of files, database records, users, access logs, redirects and persistence mechanisms.

Why does this infection come back?

Reinfection usually means the backdoor, vulnerable entry point, compromised credentials or database payload was not removed during the first cleanup.

Can WP•FIX help with this threat?

Yes. WP•FIX can investigate the symptoms, map the scope, remove malicious payloads and recommend hardening steps to reduce reinfection risk.

Need help with .htaccess Redirect Malware?

If this looks like your site, open an incident and include the symptoms, URL and any warning messages.

Open incident