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

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

CeaoS Gabby
1#
CeaoS Gabby Published in 2018-01-11 15:09:51Z

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!

Rich Bowen
2#
Rich Bowen Reply to 2018-01-11 15:16:34Z

The [QSD] (query string discard) flag added to your RewriteRule will drop the query string.

You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO