Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Redirect Users with a specific IP

    I am blocking a few IP address ranges. Since I am blocking a range, I want to redirect them to a page with a contact form (with a reCaptcha) instead of giving them a 403 error, just in case I am blocking legitimate users. I have three files, contact-form.php, contact-form-handler.php, and contact-form-thankyou.php. I want those to be the only pages they can access and redirect them to contact-form.php. I would like to use .htaccess and mod_rewrite to do so.

  • #2
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is a good concept, but I suspect it won't work due to the decimals in the IP.

    PHP Code:
    if (REMOTE_ADDR 121.456.7.8 && REMOTE_ADDR <= 123.456.7.8) {
        
    Redirect foo;
    } else {
        
    Redirect bar;



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •