How to de-index hacked index.php pages

Tucky

New member
Sep 30, 2011
464
2
0
UK
Ok so one of my sites has the pharma hack which has now been removed but there are still hundreds of hacked pages showing in the G index. They are all under the index.php path, so for instance mydomain.com/index.php?buy-cheap-finasteride etc.

I can go into GWMT and get them removed one by one but that's time consuming to say the least. Is there a way I can use htaccess or robots.txt to block all of those? I'm thinking there should be a way to de-index all pages beginning with /index.php?

Any ideas from you lovely gay webmysters?
 


404 index.php then

Google does allow wild-card in robots.txt so you could try /index.php?* but that prevents them from accessing the pages, it won't remove them right away or maybe even anytime soon.

It's probably easier just to make / edit index.php and check for query string, if it exists just redirect/404 then G will get it taken down, and if it's hurting 404 is your best bet IMHO.
 
i'd go with 410 over 404 in this instance
 
Todd, what query string do you mean?

Thanks guys

PHP: $_SERVER - Manual

$_SERVER['QUERY_STRING']
'QUERY_STRING' The query string, if any, via which the page was accessed.
You mentioned in your post they were query strings of index.php, although your 'sample' I'm not sure if it was a TRUE sample or just some typing you did.

I also don't know what software you are using or if your software needs query strings on index.php for navigation, thus you need some conditionals to make sure you aren't fucking your "GOOD" pages. :338:
 
i'd go with 410 over 404 in this instance

Isn't it funny so few people know what a 410 is nowadays?

I agree with you, but luckily G treats them the same. Using a 404 will probably save him time since he has a 404 page setup, but you're right a 410 is the proper one to use :D

The short answer is that we do sometimes treat for 404s and 410s a little bit differently, but for the most part you shouldn't worry about it," Cutts said.
 
Ok well I'm gonna pass this on to my web guy as this shit is over my head. The site is on opencart. The sample was real apart from the actual domain.