Simply noticing that visiting your website results in a redirect to a spammy or scammy website is the first indication that your site is likely hacked.
The more reliable way (and the way we recommend) to diagnose if and how your website is hacked is to use a trusted malware scanning tool.
Once your malware scanner finishes running, it will provide a report with details about what files are infected and in what way. This will determine how you proceed.
In some situations, the issue could be caused by a new file that was added to the root folder. In that case, the first step would be to remove that file. Similarly, the issue could be from a new block of code added to the top of an existing file such as the home page, in which case the first step would be to remove that block of code.
Next, to make sure you didn�t miss any additional infected files or resources, restore your website to the last known non-infected backup when your website was not redirecting to another site.
Have more quires? Chat with an Expert, or Submit Ticket to get in touch.