Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-21-2012, 12:32 AM   PM User | #1
ethanh
New to the CF scene

 
Join Date: Mar 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ethanh is an unknown quantity at this point
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.
ethanh is offline   Reply With Quote
Old 03-21-2012, 09:34 AM   PM User | #2
Etnica
New to the CF scene

 
Join Date: Mar 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Etnica is an unknown quantity at this point
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;

Etnica is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:11 AM.


Advertisement
Log in to turn off these ads.