Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7860401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:16:15+00:00 2026-06-02T22:16:15+00:00

I have a login system that I am trying to make as secure as

  • 0

I have a login system that I am trying to make as secure as possible. After ten failed attempts, I would like to block the IP address. How can I open a file in PHP and add a line to my .htaccess file to block the IP Address? Here is my .htaccess file:

# Turn on RewriteEngine
RewriteEngine on

# Block IP addresses with too many failed attempts
RewriteCond %{REMOTE_ADDR} ^217.172.179.*$ [OR]
RewriteCond %{REMOTE_ADDR} ^217.172.180.*$
RewriteCond %{REQUEST_URI} !/error/blocked.php$ [NC]
RewriteRule ^(.*)$ /error/blocked.php [R,NC,L]

I would like the PHP file to add the line:

RewriteCond %{REMOTE_ADDR} ^IPHERE$ [OR]

in the appropriate spot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:16:16+00:00Added an answer on June 2, 2026 at 10:16 pm

    I wouldn’t recommend editing the .htaccess file directly.

    Instead, have a file or a database table to save all of the blacklisted IP addresses, and test against that in PHP, rather than on Apache’s side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple login system that will have the forms and
I'm in the process of trying to make a secure PHP based login system
I'm using PHP 4.3.9, Apache/2.0.52 I'm trying to get a login system working that
So at Im trying to make a CMS system that utilizies the yahoo messenger
I am trying to make a login form through Oracle's Form Builder, I have
I have a booking system that i'm trying to set up. I want to
I have set up a login system that checks a mysql db validating username,hashed
I am trying to make a login screen that can read the usernames and
I am trying to make a basic authentication system in iOS that sends a
I have a login system, and while logged in, if I refresh the browser,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.