Thanks, but it seems to add a double “www”.
For example when I type in subsitename.com it seems to change in https://www.www.subsitename.com.
BTW I use domainmapping, but prefer to use the www variants as prefered domain anyway.
I enclosed my complete htaccess code here:
<Files wp-login.php>
Order Deny,Allow
#Deny from all
Allow from 83.117.224.220
</Files>
# BEGIN WEBSITE SPEED BOOST
# Time cheat sheet in seconds
# A17200 = 5 uur
# A86400 = 1 day
# A172800 = 2 days
# A2419200 = 1 month
# A4838400 = 2 months
# A29030400 = 1 year
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|gif|jpg|jpeg|png|swf)$">
Header append Cache-Control "public"
</FilesMatch>
<FilesMatch "\.(txt|html)$">
Header append Cache-Control "proxy-revalidate"
</FilesMatch>
<FilesMatch "\.(php|cgi|pl|htm|xml)$">
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault A300
ExpiresByType image/jpg A4838400
ExpiresByType image/gif A4838400
ExpiresByType image/png A4838400
ExpiresByType image/jpeg A4838400
ExpiresByType application/x-shockwave-flash A4838400
ExpiresByType application/x-javascript A17200
ExpiresByType application/javascript A17200
ExpiresByType text/javascript A17200
ExpiresByType text/css A300
ExpiresByType text/html A300
</IfModule>
<IfModule mod_deflate.c>
# Compress everything except images
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
# END WEBSITE SPEED BOOST
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
### BEGIN WWW and HTTPS REDIRECTS
<IfModule rewrite_module>
## BEGIN non-WWW to WWW only for Network Subsites
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)\ HTTP/ [NC]
RewriteCond %{HTTP_HOST} !\.mainsitename\.com$ [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L]
## END non-WWW to WWW only for Network Subsites
## BEGIN HTTPS Catch-All
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)\ HTTP/ [NC]
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L]
## END HTTPS Catch-All
</IfModule>
### END WWW and HTTPS REDIRECTS
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress
# disable directory browsing
Options All -Indexes
<Files .htaccess>
order allow,deny
deny from all
</Files>
<Files wp-config.php>
order allow,deny
deny from all
</Files>