Change the access url to ip in htacess

Asked

Viewed 122 times

1

I have a system that is all configuring with the address fixed in the code, for example: 'site.producao.com.br', and is in ip 10.109.104.27, but the development server is in the http://site.dev in ip 10.108.105.59.

Is there a way in htacess to make sure that if ip is dev ( .59 ) it points to the 'site.dev' url? No need to change the whole code?

Thank you!

1 answer

1

Try.

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^10.108.105.59
RewriteRule ^.*$  http://site.dev [L]
  • Thanks buddy, I’ll try!

Browser other questions tagged

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