On Jul 22, 2011, at 8:10 AM, Lynn Stott (Stott Design) wrote: Can some help with .htaccess?
How do you redirect all https://www.site.com http://www.site.com http://site.com
to
On Fri, 2011-07-22 at 08:24 -0600, Lynn Stott wrote: I think I got it. Both statements are necessary, I think... any comment?
RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://mysite.com/$1 [R,L]
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] RewriteRule ^ https://%1%%7BREQUEST_URI%7D [L,R=301]
http://wiki.apache.org/httpd/RewriteHTTPToHTTPS in your .htaccess with mod_rewrite
or
http://wiki.apache.org/httpd/RedirectSSL in your virtual-host-conf with mod_alias(??)
the latest is the recommended one.
actually it's more like RewriteRule ^/?(.*)$ https://mysite.com/$1 [R,L]
with this note about "/?"--that i added--as seen in the first link: # The leading slash is made optional so that this will work either # in httpd.conf or .htaccess context
fireh.