title: Redirect http to https by configuring .conf file of apache
body: <p>I have configure apache to tomcat configuration by code like </p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  ServerName captiveportal
  ProxyPass       / http://ip:port/path
  ProxyPassReverse / http://ip:port/path
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Now i want to reirect this request to https 
  How can i achieve this ?</p>
  
  <p>After looking your answer i have changes my configuration like </p>
  
  <pre><code>&lt;VirtualHost *:443&gt;
  SSLEngine on
  SSLCertificateFile "/etc/httpd/conf/crt1.crt"
  SSLCertificateKeyFile "/etc/httpd/conf/key1.key"
  ProxyPass       / http://ip:port/path
  &lt;/VirtualHost&gt;
  &lt;VirtualHost *:80&gt;
  ServerName captiveportal
  Redirect / https://ip:port/path
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>but when i type <code>captiveportal</code> on my browser it redirects me on url <code>https://ip:port/path</code> and it displays <code>problem loading page</code></p>
  
  <p>One more thing i don't want to display <code>https://ip:port/path</code> on browser.</p>
  
  <p>Note :- <code>https://ip:port/path</code>  where port is my tomcat port and ip is machine ip where tomcat run.</p>