Google Search Console notified us of several 'Server Error 5(xx)' Google Console Errors These are URL redirects to an adult website. eg: https://example.com/?URL=https://xxxvideo4.com/result/PORNOGRAPHYTERMS an example of this type of attack is shown here: https://cwe.mitre.org/data/definitions/601.html

I do not see these URLS listed in our sitemap, and I am unsure how GSC would have indexed them to begin with. It is possible that someone accessed our server, as we found a 3 year old piece of malware, however the sitemap looks fine. There might have been access to our .htaccess file, but I am unsure.

I am hoping someone can assist me in "next steps".

  • How can I search for the code that allows this type of redirect? It looks like it can be in javascript or php - unsure how I would search for that
  • How would I write the .htaccess rule to rewrite all /?URL to either block this, or rewrite to the homepage
  • Will the above step address the GSC errors?
  • Should I request the removal of these URLs from GSC?

Thanks in advance

Edit: Here are the redirect messages I see when I try to access the links from GSC enter image description here

Here is the redirect message I see when I add a non crawled URL using the redirect ?URL=
enter image description here

  • I'm not sure what you expect your sitemap to have to do with this. Google doesn't limit indexed URLs to just those in your sitemap. XML sitemaps don't help with getting the URLs in them indexed, nor do they prevent other URLs from getting indexed. At best sitemaps help your site get crawled and give you extra stats in GSC. Feb 22 at 11:22
  • Are these URLs consistently showing 500 errors? If so, Google already shouldn't be indexing them. You should worry about URLs where an open redirect actually works. Feb 22 at 11:23
  • @StephenOstermiller I assumed that would be the primary way these redirects would get indexed. With other hacks I've seen, the fake pages are added, and the CMS automatically updates the sitemap. I am unsure how GSC would have indexed a redirect. If you have ideas on how that would have happened, I would appreciate it.
    – Heavy Mod
    Feb 22 at 19:52
  • The report you are looking at shows that Google crawled those URLs, which is very different from indexing them. Google doesn't usually index redirects either, but it may index them in a few circumstances and this malware may be trying to exploit those circumstances. It may also just by trying to pass link juice through your site or evade penalties on other domains. Feb 22 at 19:58
  • @StephenOstermiller Following one of these redirects does appear to work in that it produces a redirect warning message. This is why my questions requests how to write the .htaccess rule to rewrite these redirects, as well as suggestions on how to search for the code that is allowing a redirect in the first place. I will update my post to include screenshots of the redirects.
    – Heavy Mod
    Feb 22 at 20:25


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.