Tag Archives: mod_rewrite

howto replace domain with mod_rewrite


We need to replace domain name for all host, besides some networks:
edit .htaccess:
RewriteEngine on
RewriteCond %{REMOTE_ADDR}      !^192\.168\.11\.
RewriteCond %{REMOTE_ADDR}      !^192\.168\.16\.
RewriteRule ^(.*)$ http://intra/bugzilla_mail/$1 [L]
Results:
from host with ip: 192.168.1.12
in web browser write: http://intra/bugzilla/test.cgi
and redirected to http://intra/bugzilla_mail/test.cgi
from host with ip: 192.168.11.44
in web browser write: http://intra/bugzilla/test.cgi
and see : http://intra/bugzilla/test.cgi
that's all.