Found · Symptom guide

My .htaccess or wp-config.php has been changed. What does that mean?

These two files control how your site behaves, so attackers like to edit them. If either has changed and you didn’t do it, something has probably been added to redirect visitors or run code.

Hacked right now? Call us 0191 580 4040 Mon-Fri, 9am-5:30pm
Not urgent? Contact us

What this usually means

  • Extra rules in .htaccess that redirect certain visitors, such as those from Google or on mobile
  • Code added to wp-config.php that loads another file or decodes a long string
  • A .user.ini or php.ini file that loads code before every page
  • Changed file permissions that let others write to the file

How to check, step by step

  1. Take a backup first

    Keep the changed version, even if it’s bad, so it can be examined.

  2. Review .htaccess

    Look for rules that mention user agents, search engines or domains you don’t recognise.

  3. Review wp-config.php

    It should hold your database details, security keys, table prefix and settings, and then load wp-settings.php. Anything else deserves a closer look.

  4. Look for related files

    Check for .user.ini and php.ini files in your site folders.

Functions that often appear in injected code (their presence isn’t proof, but it’s worth a closer look):

Functions to look for
eval( base64_decode( gzinflate( str_rot13( auto_prepend_file

When to get help

If you find code you don’t understand in wp-config.php, don’t try to edit it live. A mistake can take the site offline. Send us the details and we’ll sort it safely.

Send us the details

Frequently asked questions

Why do attackers edit .htaccess?

Because it runs on every request. A few lines can send chosen visitors elsewhere, without changing anything in WordPress.

Can I just replace wp-config.php?

You can restore a clean version, but you’ll need your database details and keys. And you still need to find how it was changed.

Will saving permalinks fix it?

It rewrites the standard WordPress rules in .htaccess, but it doesn’t remove the cause or other files.

Call us Get in touch