htaccess Archives - Code & Computer Notes

Tag Archives for " htaccess "

Apache 2.4 redirect http to https via .htaccess

Just edit main .htaccess file and add:

RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Of course you must have load mod_rewrite in your Apache config.