Apache - how to make http requests into https only?
<p>How to tell if <a href="http://ttt.com" rel="nofollow">http://ttt.com</a> or <a href="http://www.ttt.com" rel="nofollow">http://www.ttt.com</a> is used by the user, redirect it to <a href="https://www.ttt.com" rel="nofollow">https://www.ttt.com</a> ?</p>

<p>httpd.conf:</p>

<pre><code>&lt;VirtualHost *:80&gt;
 ServerName www.ttt.com
 ServerAlias ttt.com
 DocumentRoot /home/www/html/ttt/public
 &lt;Directory /home/www/html/ttt/public&gt;
    #Options ExecCGI
    #AddDefaultCharset utf-8
    DirectoryIndex index.php
    AllowOverride All
    Order allow,deny
    Allow from all
 &lt;/Directory&gt;
&lt;/VirtualHost&gt;
</code></pre>

<p>.htaccess :</p>

<pre><code>RewriteEngine On
############################################
## always send 404 on missing files in these folders
#RewriteCond %{REQUEST_URI} !^/(files)/
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</code></pre>