Sagecore Technologies
  • Home
  • Services
    • Enterprise Resource Planning
    • Website Design & Development
    • Mobile App Development
  • Contact
Select Page

How to secure WordPress login page with HTACCESS

by Nathan Martin | Oct 15, 2018 | Blog Post, HTACCESS, Javascript, jQuery, Tutorials, Wordpress | 0 comments

How to secure WordPress login page with HTACCESS

In your .htaccess folder in your WordPress root folder, add the following code replacing example\.com with your domain name. For example: mydomain\.com mydomain\.net

This script makes sure you can only login from your domain not via a brute force $_POST attack.

[sourcecode]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{HTTP_REFERER} !^http://(.*)?example\.com [NC]
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteRule ^(.*)$ – [F]
</IfModule>
[/sourcecode]

Submit a Comment Cancel reply

You must be logged in to post a comment.

Recent Posts

  • How to secure WordPress login page with HTACCESS
  • How to track your calls with Facebook pixel.
  • How to make Ninja Forms look pretty in WordPress
  • How to create pretty urls with .HTACCESS and INDEX.PHP
  • How to force a website to HTTPS using .HTACCESS

Recent Comments

  • Anonymous on How to secure WordPress login page with HTACCESS
  • Nathan Martin on When should you redesign your website?
  • Nathan Martin on Seeing ‘not secure’ messages on your website? The fix is simple and helps your SEO!
  • admin on How to create pretty urls with .HTACCESS and INDEX.PHP

Archives

  • October 2018
  • May 2018
  • April 2017
  • January 2017

Categories

  • Blog Post
  • Facebook
  • HTACCESS
  • Javascript
  • jQuery
  • Tutorials
  • Web News
  • Wordpress

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

+1 (505) 934 8564

Services

  • Enterprise Resource Planning Software
  • Website Design & Development
  • Mobile App Development
  • iOS App Development
  • Android App Development
  • Cross-Platform App Development
  • Facebook
  • Twitter

Website Created and Maintained by Sagecore Technologies, LLC - Copyright © 2019 All Rights Reserved.