user2125467
user2125467

Reputation: 329

Webpage 410 Gone htaccess

My website had been hacked and lots of pages had been added and these have been indexed by Google. This has seriously affected the amount of traffic my site is receiving.

These pages all are all named along the lines of - '?mulberry-948.html' just with a different number for each.

I have deleted all these pages but there are back links to these from lots of websites around the web so Google is still looking for them.

Is it possible to set all of these pages as gone (410) using .htacess in a simple way without having to add this for each file (over 10000 files).

i.e can i say for anything that begins with '?mulberry' to be set as gone?

Thanks

Upvotes: 1

Views: 592

Answers (1)

Croises
Croises

Reputation: 18671

If ?mulberry is after a page name, You can do that with:

RewriteEngine on
RewriteCond %{QUERY_STRING} mulberry [NC]
RewriteRule ^ - [G,L]

if it's in the url (without ?) You can use:

RewriteEngine on
RewriteRule mulberry - [NC,G,L]

You can use both, especially if you do not use the word mulberry for your site.

Upvotes: 2

Related Questions