htaccess https to http code example
Example 1: http to https htaccess
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https:
Example 2: htaccess redirect https to http
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http:
Example 3: redirect to http to https .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https:
</IfModule>
Example 4: .htaccess redirect to https
<IfModule mod_rewrite.c>
....
....
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https:
...
...
</IfModule>