Jump to content

restrict ip address for admin login


vbatra

Recommended Posts

Is there any way to restrict the login to admin panel to specified (white listed) IP addresses only? I know I can do it from .htaccess but it would give and error rather than a message. I would like to show a login failed message when someone tries to log in outside of white listed IP addresses.

Link to comment
Share on other sites

htaccess would be the correct way to do it, but if you want to redirect to a custom failed login page, you would need to add a 403 redirect... something along the lines of...

 

order deny,allow
deny from all
allow from xx.xx.xx.xx

ErrorDocument 403 /failedlogin.php

if all you want is a very simple message rather than the default output, you could add the text directly to the htaccess file - it can include html... but if you wanted to do that, it's probably easier to redirect to a page as shown above.

 

ErrorDocument 403 "get out - you are not supposed to be here!"

Link to comment
Share on other sites

if the full admin and staff members don't use the same IP, then you could just add any unique IPs the full admin will use, plus any IPs for shared places, e.g the office, where both admin and staff will need to login.

 

you wouldn't be able to use a WHMCS admin level within htaccess to determine login access... perhaps possible with an action hook, but i'm not sure.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated