Skip to content

Instantly share code, notes, and snippets.

@aramboyajyan
Last active April 30, 2019 20:24
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aramboyajyan/b2872be03b3c48a35081 to your computer and use it in GitHub Desktop.
Save aramboyajyan/b2872be03b3c48a35081 to your computer and use it in GitHub Desktop.
.htaccess block wordpress directories (for use in Drupal websites)
# Non-existing URLs that are usually visited by bots. We will issue a server
# redirect to 404.html to avoid any overhead caused by bots trying to break into
# the site.
#
# WordPress folders.
RedirectMatch 301 /wp-admin /404.html
RedirectMatch 301 /wp-content /404.html
RedirectMatch 301 /wp-includes /404.html
# WordPress files.
RedirectMatch 301 /wp-cron.php /404.html
RedirectMatch 301 /wp-config.php /404.html
RedirectMatch 301 /wp-login.php /404.html
RedirectMatch 301 /wp-signup.php /404.html
# Random other URLs.
RedirectMatch 301 /admin.php /404.html
RedirectMatch 301 /administrator /404.html
RedirectMatch 301 /admin/fckeditor /404.html
This page does not exist. <a href="./">Click here</a> to go back to the home page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment