como redigio mi ip al dominio

Posted November 26, 2020 698 views

disculpe pero como hago para que si alguien sepe la ip le rediriga al dominio
por ejemplo
pone la ip -> 17.1321.1231.1 -> se vaya a y no se quede en 12-23-1.132

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @proyectszonaentrenamient,

You can achieve this with a rewrite in an htaccess file in your DocumentRoot directory. Go to the folder


In the folder, you should have a configuration file named 000-default.conf. You will need to be sure that your 000-default.conf file has AllowOverride All set for the DocumentRoot directory so the settings in your htaccess file will be used. Then you will want to create an .htaccess file in that directory with the following (replacing the IP and domain with your own):

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^12\.34\.56\.789$
RewriteRule ^(.*)$$1 [L,R=301]

once this is done, make sure the rewrite module is enabled:

a2enmod rewrite

and restart apache

service apache2 restart