0

I have configured the host name for a specific machine.

Ip Address : 192.XXX.XXX.XXX HostName : https://www.mymachine.com/link1

When the user hits the browser using IP, i want him to be redirected to hostname.

What is the apache configuration to be added?

sanghavi7
  • 758
  • 1
  • 15
  • 38
Poppy
  • 2,902
  • 14
  • 51
  • 75

1 Answers1

0

first you try this short setting..

<VirtualHost *>
       ServerName www.myDomain.com
       DocumentRoot /www/myDomainRoot
</VirtualHost>

/* then after detailed configuration for that */

/etc/apache2/sites-available/default

<VirtualHost <yourIP address>:<PortNo>>
    
    ServerAdmin webmaster@localhost
    ServerName application.mymachine #or whatever
    
DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

</VirtualHost>
Community
  • 1
  • 1
sanghavi7
  • 758
  • 1
  • 15
  • 38