1

Recently rebuilt a site that was on wordpress to Craft CMS, and I am seeing a ton of hits trying to find files in /wp-content - Is there a way I can just set Retour to catch any request for anything in the /wp-content directory are redirect it to a single image file?

2 Answers 2

3

FWIW, I would actually recommend doing this rewrite at the web server level, because then these accesses will have a much lower impact on your site.

If you add the redirect to Nginx (or whatever your webserver is), these bot-spam hits won't have to cause Nginx, Craft, etc. to kick in before they operate. An example is here for Nginx:

https://github.com/nystudio107/nginx-craft/blob/master/sites-available/somedomain.com.conf#L72

    # For WordPress bots/users
    location ~ ^/(wp-login|wp-admin|wp-config|wp-content|wp-includes|xmlrpc) {
        return 301 https://wordpress.com/wp-login.php;
    }
1

Got it. Figured I would keep this here for anyone else looking to do this (or similar).

.*/wp-content($|/.*) 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.