Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have recently been the victim of this hacking exploit (blog post is for reference only and is not my site. I'm in the process of following it and cleaning up after the attack).

Note the exploit at the top of my .htaccess file;

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule myq-(.*).htm$ wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/style.css.php [L]
</IfModule>

Options +FollowSymLinks
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>

<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

<IfModule mod_rewrite.c>

# BEGIN WordPress
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
</IfModule>

So the exploit has had the effect of producing hundreds of spam links in Google, but under my domain name. Some examples;

...

Printable coloring pages of a caterpillar mysite.com
mysite.com/myq-zjjcq.htm

Coloured lettering cut out mysite.com
mysite.com/myq-viki-60693.htm

Printable leopard coloring page mysite.com
mysite.com/myq-96.htm

Printable oedipus rex mysite.com
mysite.com/myq-ei9vd.htm

...

What is the most effective way to combat these links by using Google Webmaster Tools and .htaccess to get rid of them from the Google results.

Is it best to serve a 404? How can I achieve this using the .htaccess file?

The site is hosted is on a shared server. I only have access to a limited cPanel and FTP for any form of site configuration.

Any pointers appreciated. Thanks in advance.

share|improve this question

1 Answer 1

Serve a 404 error. That will tell Google and other search engines to remove those pages from their index. Deleting the files themselves will all be you need to do. No need to do anything with .htaccess or otherwise.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.