Following this article: http://premium.wpmudev.org/blog/limit-access-login-page/
I have included the following code in my .htaccess file:
ErrorDocument 401 /path-to-your-site/index.php?error=404
ErrorDocument 403 /path-to-your-site/index.php?error=404
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{HTTP_REFERER} !^http://(.*)?your-site.com [NC]
RewriteCond %{REQUEST_URI} ^(.*)?wp-login.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteRule ^(.*)$ - [F]
</IfModule>
My website’s URL does include the “www” portion, therefore is it safe/okay to include the “www” for the following line:
RewriteCond %{HTTP_REFERER} !^http://(.*)?www.your-site.com [NC]
I’m not very familiar with editing the .htaccess document, I appreciate any help. Thank you
To only allow
www
site your this directive:This will also allow
https
protocol.