title: Redirect from IP Address to Domain
body: <p>I have a plain webpage (no CMS). If I go to mydomain.com, it displays my webpage, as it should. However, if I go to my server's IP address, it displays my page as well but in the address bar, it still shows my server's IP address. How can I make it so that if I enter the IP address, it automatically redirects you to my page's domain name using the virtual host entry (not the .htaccess file)? My current vhost entry looks like this:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      DocumentRoot /var/www/mydomain.com
      ServerName mydomain.com
  &lt;/VirtualHost&gt;
  </code></pre>