access site by domain but not by explicit ip

Discussion in 'Apache' started by oscaroxy, Aug 29, 2016.

  1. #2
    I would configure httpd in order to access to site by domain but not by explicit ip. my config is:

    <VirtualHost 192.168.1.44:80>
    ServerName XXX.net
    ServerAlias www.XXX.net

    DocumentRoot /var/www/html/XXX
    DirectoryIndex index.php
    ErrorLog /var/log/httpd/error_log_XXX
    CustomLog /var/log/httpd/access_log_XXX common
    <Directory "/var/www/html/XXX/">
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    I would to access by www.XXX.net but not by 192.168.1.44.... how di I set httpd.conf?

    thanks
     
    Last edited by a moderator: Aug 29, 2016
    oscaroxy, Aug 29, 2016 IP