RewriteEngine On
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
To force redirect from http to https, and from www. to no-www., insert in .htaccess following code:
- SSL, Apache, .htaccess
- 1 Users Found This Useful