.htaccess 常時https で wwwなしの設定

常時https で wwwなし

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{HTTPS} off 
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
</IfModule>