Sign up ×
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]

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

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

order deny,allow
deny from all

<IfModule mod_rewrite.c>

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

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

Coloured lettering cut out

Printable leopard coloring page

Printable oedipus rex


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


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.