Home htaccess redirect files with the same name to just one file (been hacked)
Reply: 0

htaccess redirect files with the same name to just one file (been hacked)

user1048
1#
user1048 Published in April 24, 2018, 6:36 am

I would like your help to modify my .htaccess file. My site has been hacked and the malware has created thousands of pages and has really hurt my rankings. I have deleted the pages, but I want all of those links to redirect to one 404 page.

What do I need to write in .htaccess in order to redirect all of the pages that contain a certain word?

I have tried this

RewriteCond %{QUERY_STRING} ^(theword)

RewriteRule ^$ https://example.com/404.php [R=301,L]

But it doesn't seem to work: the 404 page I created appears, but the link still remains in the browser, just that now it's like this

http://example.com/404.php?theword=blablabla

Maybe because my site is on a wordpress platform?

I want all the pages that start with ?theword= to be redirected entirely and for the new link to appear /404.php not /404.php?theword=

Thank you in advance for your help!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.298951 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO