WordPress.org

Forums

[resolved] Restrict login and registrations access (3 posts)

  1. pete_398
    Member
    Posted 3 years ago #

    We don't allow registrations or comments, simply use WordPress for posting articles. We didn't want anyone trying to login or to register, so this mod rewrite did the trick

    Options +FollowSymLinks
    RewriteEngine on
    #
    RewriteCond %{REMOTE_ADDR} !^your\.ip\.add\.ress$
    RewriteRule ^(wp-login|wp-register)\.php?$ - [F]

    Simply replace "your\.ip\.add\.ress" with your IP address, and then ONLY you can login.

    It returns a 403 if anyone attempts to login or register. Add other files as needed.

    Now to the request. It is already defined in WordPress that we have turned off new registrations. Simply use that config setting to return a 403, or similar if defined by the user.

  2. Bear in mind that if your IP changes, you can't get in.

    Better would be to disable comments and registration on the site. It's a built in option.

  3. pete_398
    Member
    Posted 3 years ago #

    Bear in mind that if your IP changes, you can't get in.

    That's obvious. My IP is dedicated, I can change if it need be for no fees, and I don't have any need at all to access the website whilst away (i.e. when an IP address may change for example).

    Better would be to disable comments and registration on the site. It's a built in option.

    Disabling on those 2 functions was already done, but it doesn't stop anyone trying to access those 2 files. The mod_rewrite does. :D

Topic Closed

This topic has been closed to new replies.

About this Topic