Uncategorized, Web server

How to redirect html site to https using htaccess

If you use apache web-server. Place .htaccess file to root site folder:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://domain.com/$1 [R,L]

Leave a Reply

Your email address will not be published. Required fields are marked *