natasha_thomas Posted January 26, 2011 Share Posted January 26, 2011 Folkks, I want to redirect to all the visitors form a particular IP range to another URL. I am not able to integrate the redirect code into my existing .htaccess. My Current .htaccess is: Options -Indexes ErrorDocument 404 / ErrorDocument 403 / ErrorDocument 500 / RewriteEngine On RewriteRule ^.*/.*\.htm$ 404.php [L] RewriteRule ^([^\.]*)?\.htm$ index.php?name=$1 [NC,L] RewriteRule .* - [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}] RewriteRule .* - [E=HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}] RewriteRule ^images/e/(.*)$ http://thumbs.ebaystatic.com/pict/$1 [R,L] RewriteRule ^item-(.*)_(.*)_(.*)_(.*).html$ auction.php?title=$1&item=$2&country=$3&ccid=$4 RewriteRule ^item-(.*)_(.*)_(.*).html$ auction.php?title=$1&item=$2&country=$3 RewriteRule ^item-(.*)_(.*).html$ auction.php?title=$1&item=$2 The IP range to be banned is: <Limit GET HEAD POST> order allow,deny # Country: JAPAN # ISO Code: JP # Total Networks: 2,428 # Total Subnets: 187,283,712 deny from 1.21.0.0/16 deny from 1.33.0.0/16 deny from 1.66.0.0/15 deny from 1.72.0.0/13 deny from 1.112.0.0/14 # allow from all </Limit> How to integrate this IP range code in existing Htaccess then redirect the visitor form this IP range, ensuring there is no conflict with exiting .htaccess? Cheers Natasha T Quote Link to comment https://forums.phpfreaks.com/topic/225749-deny-ip-range-with-htaccess-and-redirecting/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.