skip to Main Content

My WordPress has been hacked and cleaned, but now tens of thousands pages return 404 http code from Googlebot and other search engine witch saturate my hosting and SEO is a disaster.

My web site have only ten pages and i would like send an 410 http code for every urls exept my ten pages (and other stuff like images)

Here where I am

RewriteCond %{REQUEST_URI} !^/$ [OR]
RewriteCond %{REQUEST_URI} !^(.*)nos-prestations(.*)$ [OR]
RewriteCond %{REQUEST_URI} !^(.*)pour-les-entreprises$ [OR]
RewriteCond %{REQUEST_URI} !^(.*)wp-content(.*)$
RewriteRule ^ - [G]

But all pages return 410
Where is my mistake ?

Tanks a lot.

Edit, my legitimates URLs

https://www.kidooland.fr
https://www.kidooland.fr/nos-prestations/
https://www.kidooland.fr/pour-les-entreprises/
https://www.kidooland.fr/arbre-de-noel-entreprises/
https://www.kidooland.fr/le-foot-en-salle/
https://www.kidooland.fr/news/
https://www.kidooland.fr/contact/
https://www.kidooland.fr/kidooland-le-parc/
https://www.kidooland.fr/parents-enfants/
https://www.kidooland.fr/le-foot-en-salle/
https://www.kidooland.fr/tarifs-horaires/

2

Answers


  1. With your shown samples, could you please try following. Please make sure you clear your cache before testing your URLs.

    RewriteEngine ON
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(nos-prestations|pour-les-entreprises|arbre-de-noel-entreprises|le-foot-en-salle|news|contact|kidooland-le-parc|kidooland-le-parc|le-foot-en-salle|tarifs-horaires) [NC]
    RewriteRule ^ - [G,L]
    
    Login or Signup to reply.
  2. You may try this rule at top of your .htaccess, just below RewriteEngine On line:

    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{THE_REQUEST} !s/+(?:nos-prestations|pour-les-entreprises|arbre-de-noel-entreprises|le-foot-en-salle|news|contact|kidooland-le-parc|le-foot-en-salle|tarifs-horaires)?/?s [NC]
    RewriteRule . - [G,L]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search