WebsiteTrouble Blog · Hacked Sites and Security
Your Website Redirects Visitors to Spam. Here Is What Happened
You see your normal site, but visitors land on gambling or pharma spam. How conditional redirects hide from owners, and why this is a same-day emergency.
Here is the phone call I get. A customer tells the owner their website sent them to a casino page. The owner pulls up the site, and it looks completely fine. Loads normal, right pages, right phone number. So the owner decides the customer must have clicked something wrong. A month later it happens again, then again, and by then Google has noticed too.
Nobody was confused. The site really was doing both things at once.
How a redirect hides from the owner
This is the classic pattern, and it is deliberate. The malicious code checks who is visiting before it decides what to do. Owners and admins usually visit by typing the address directly, often while logged in, often from the same computer every day. So the code serves them the normal site.
Visitors are different. They arrive from a Google search, or on a phone, or for the first time. Those are the people the hacker wants, because they are the ones who might click the gambling page, the pharmacy store, or the fake giveaway. So the redirect fires for them and stays silent for you. Some versions only fire once per visitor, so even a customer who goes back to show you will see your clean site the second time.
That is how these run for months. The people who see the problem cannot reproduce it, and the person who owns the site never sees it at all.
Where these redirects usually live
There is no single hiding place, which is why poking one file rarely ends it. Common spots include:
- An infected theme or plugin file with a few lines of code added near the top
- The site's database, where redirect rules get stored so they survive file cleanups
- Configuration files at the server level that most owners never open
- A fake admin account that lets them come back and reinstall it
- Scheduled tasks on the server that rebuild the redirect after you delete it
It also means the redirect is only the visible part. Something let them in, and something is usually set up to let them back in. If you have not checked the other symptoms yet, the full list of signs that a website is hacked is worth ten minutes.
Why this is a same day problem
Every day this runs, real customers who searched for you by name land on a scam page with your business attached to it. Some of them never come back. Some of them tell you, most do not. Meanwhile your site is spending its good name sending traffic to criminals, and when Google catches it, and it will, you get the hacked label on top of the lost customers.
I treat live visitor redirects as an emergency. It is one of the clearest cases for emergency website help, same day, first hour $299, because the meter really is running on your reputation.
What the fix actually takes
Not just removing the redirect. The job is finding every copy of it, every door it came through, and every spare key they left behind, then closing all of it in one pass. I walk through that sequence in what a real hack cleanup involves, because owners deserve to know what they are paying for before anybody starts.
When I take one of these on, we do it live on a screen share while you watch. I will show you the redirect condition itself, the code that checks whether you are the owner, so you can see exactly why you never saw it, and then we remove it together and test the site the way a stranger from Google would.
Rather have it fixed today?
This is the kind of problem I fix live on a screen share, while you watch. A standard fix is $99 for the first hour, same-day emergency help is $299 for the first hour, and every fix carries a 30-day warranty.