Redirect by htaccess

0

Good afternoon, I need to do the following in my .htaccess.

If the REMOTE_ADDR (IP) is in this range 192.168.0.1 through 192.168.10.254

  

192.168.0.5/system

If REMOTE_ADDR (IP) is an external IP, type 177.45.85.95

  

system.company.com

See my .htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On
  # Determina a base de reescrita
  RewriteBase /sistema
  # Verifica se a url nao corresponde a um arquivo existente
  RewriteCond %{REQUEST_FILENAME} !-f
  # Verifica se a url nao corresponde a um diretorio existente
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .([a-zA-Z0-9]+)?$ index.php
</IfModule>
    
asked by anonymous 01.06.2016 / 21:30

1 answer

0

With a if directive you can do:

<If "%{HTTP_HOST} != 'www.example.com'">
Redirect / http://www.example.com/
</If>


    
01.06.2016 / 21:38