Redirect via htaccess

Asked

Viewed 132 times

0

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

If the REMOTE_ADDR (IP) for nesse range 192.168.0.1 até 192.168.10.254 acessa por

192.168.0.5/system

If the REMOTE_ADDR (IP) for an external IP, type 177.45.85.95 accesses by

.empresa.com.br system

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>

1 answer

0

With a if Directive it is possible to do:

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


Browser other questions tagged

You are not signed in. Login or sign up in order to post.