title: What causes the default Apache page to open up when the Moodle site is loaded
body: <p>My site <code>www.site.com</code> loads apache2 'It works' page instead of the expected home page of moode which is located at <code>/var/www/html/moodle</code>. There is an index file <code>index.php</code> inside moodle directory but it is not taken by default. If I go to <code>www.site.com/moodle</code> the site homepage comes. The configuration file <code>/etc/apache2/sites-available/site.conf</code> is enabled. How to solve this?</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName www.site.com
      ServerAlias site.com
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html/moodle
      DirectoryIndex index.php
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
      RewriteEngine on
      RewriteCond %{SERVER_NAME} =www.site.com
      RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} 
      [END,NE,R=permanent]
  &lt;/VirtualHost&gt;
  </code></pre>