Clean URLS work with http, but not with https When I visit ?q=admin/config/search/clean-urls via HTTP I am able to enable clean URLs and they work fine. 

However, when I visit the same path via HTTPS I am not able to enable clean URLs and get this error:



Here is my apache conf file for http:

NameVirtualHost *:80

&lt;VirtualHost *:80&gt;

    UseCanonicalName Off
    ServerAdmin webmaster@localhost
    DocumentRoot /media/www_drive/drupal7

  &lt;Directory /media/www_drive/drupal7&gt;
    Require all granted
    AllowOverride All
  &lt;/Directory&gt;

&lt;/VirtualHost&gt;


Here is my apache conf file for https

NameVirtualHost *:443
&lt;VirtualHost *:443&gt;

    SSLEngine on
    SSLCertificateFile /etc/ssl/cgps/star.cgps.org.crt
    SSLCertificateKeyFile /etc/ssl/cgps/np_cgps.key
    ServerAdmin webmaster@cgps.org
    DocumentRoot /media/www_drive/drupal7
    SSLCACertificateFile /etc/ssl/cgps/RapidSSL.crt

    &lt;Directory /media/www_drive/drupal7&gt;
      Require all granted
      AllowOverride All
    &lt;/Directory&gt;

&lt;/VirtualHost&gt;


Shouldn't this config use the same .htacess file in the drupal root for both HTTP and HTTPS? What could cause clean URLs to fail to pass the check via HTTPS?
You can try below with changing in .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} off   
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}