View: 2710|Reply: 0

HTaccess redirect by IP range

[Copy link]
Posted on 3-12-2013 16:37:58 | Show all floors |Reading mode
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On
  3. RewriteCond %{REMOTE_ADDR} ^85\.204\.$ [OR]
  4. RewriteRule ^(.*)$ clientsA.html [R,L]

  5. RewriteCond %{REMOTE_ADDR} ^95\.178\.124\.$ [OR]
  6. RewriteRule ^(.*)$ clientsB.html [R,L]

  7. </IfModule>
Copy code
example
  1. RewriteEngine On
  2. RewriteCond %{REMOTE_HOST} 12.228 [NC,OR]
  3. RewriteCond %{REMOTE_HOST} 76.85 [NC,OR]
  4. RewriteCond %{REMOTE_HOST} 98.145 [NC,OR]
  5. RewriteCond %{REMOTE_HOST} 108.167 [NC]
  6. RewriteRule .* http://www.google.com/ [R=301,L]
Copy code
  1. RewriteEngine on
  2. RewriteCond %{REMOTE_ADDR} !^(123\.45\.67\.89|213\.45\.67\.89)
  3. RewriteCond %{REQUEST_URI} !/custom-message\.html$
  4. RewriteCond %{REQUEST_URI} !/custom-message\.png$
  5. RewriteRule .* /custom-message\.html [R=307,L]
Copy code
Reply

Use item Report

You need to log in to reply. Login | Register

Points Rules for This Section

Theo dõi bản tin
Archiver|Mobile|Facebook|Contact|Netdepviet.org

Giữ gìn bản sắc dân tộc · Trân trọng quá khứ, hướng tới tương lai。

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

InThis boardPost
Kết nối Zalo
Back to top