0

How can I redirect the path /blog/xmlrpc.php?rsd to /blog/ in my .htaccess?

I tried the following below but it doesn't work:

Redirect 301 "/blog/xmlrpc.php?rsd" "/blog/"

and this doesn't work either:

RewriteEngine on RewriteRule ^/blog/xmlrpc.php.* /blog/ [R=301,L]

The end result is always:

https://www.example.com/blog/?rsd

How can I get this redirect to work so it doesn't end with '?rsd' or anything else.

1 Answers1

0

Here's what you need.

RewriteEngine On
RewriteCond %{QUERY_STRING} ^rsd$
RewriteRule ^/blog/xmlrpc.php.*$ /blog/? [R=301,L]

For more details, refer to the first answer (by Fabian) on this mod_rewrite question.

Community
  • 1
  • 1
Ezequiel Tolnay
  • 4,302
  • 1
  • 19
  • 28