Title: No www to www with HTTPS
Last modified: August 30, 2016

---

# No www to www with HTTPS

 *  [MHV.nl](https://wordpress.org/support/users/mhvnl/)
 * (@mhvnl)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/no-www-to-www-with-https/)
 * Hey,
 * I got an ssl certificate for my [http://www.domain.com](http://www.domain.com)
   and want to refer the domain.com to the www. version. I found some questions 
   about this on the forum but not in combination with HTTPS.
 * what i got now is
 * <IfModule mod_rewrite.c>
    RewriteEngine On RewriteBase / RewriteCond %{HTTPS}
   on RewriteRule .* – [E=WPR_SSL:-https] RewriteCond %{SERVER_PORT} ^443$ RewriteRule.*–[
   E=WPR_SSL:-https] RewriteCond %{HTTP:Accept-Encoding} gzip RewriteRule .* – [
   E=WPR_ENC:_gzip] RewriteCond %{REQUEST_METHOD} GET RewriteCond %{QUERY_STRING}
   =”” RewriteCond %{HTTP:Cookie} !(wordpress_logged_in_|wp-postpass_|wptouch_switch_toggle
   |comment_author_|comment_author_email_) [NC] RewriteCond %{REQUEST_URI} !^(.*/
   feed/?)$ [NC] RewriteCond %{HTTP_USER_AGENT} !^(facebookexternalhit).* [NC] RewriteCond“%{
   DOCUMENT_ROOT}/home/tribevi2/domains/bv-oprichten.com/public_html/wp-content/
   cache/wp-rocket/%{HTTP_HOST}%{REQUEST_URI}/index%{ENV:WPR_SSL}.html%{ENV:WPR_ENC}”-
   f RewriteRule .* “/home/tribevi2/domains/bv-oprichten.com/public_html/wp-content/
   cache/wp-rocket/%{HTTP_HOST}%{REQUEST_URI}/index%{ENV:WPR_SSL}.html%{ENV:WPR_ENC}”[
   L] </IfModule> # END WP Rocket
 * # BEGIN rlrssslReallySimpleSSL rsssl_version[2.2.12]
    <IfModule mod_rewrite.c
   > RewriteEngine on RewriteCond %{HTTPS} !=on [NC] RewriteRule ^(.*)$ [https://%](https://%){
   HTTP_HOST}/$1 [R=301,L] </IfModule> <IfModule mod_headers.c> Header always set
   Strict-Transport-Security ‘max-age=31536000’ env=HTTPS </IfModule> # END rlrssslReallySimpleSSL#
   BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule
   ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}!-
   d RewriteRule . /index.php [L] </IfModule>

Viewing 1 replies (of 1 total)

 *  [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * (@kentonwebdesign)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/no-www-to-www-with-https/#post-6890604)
 * Hi,
 * Why not just do;
 *     ```
       RewriteEngine On
       RewriteCond %{HTTP_HOST} !^www\. [NC]
       RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
       RewriteCond %{HTTPS} off
       RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]
       ```
   
 * or if you don’t need HTTPS redirect just do the first line;
 *     ```
       RewriteEngine On
       RewriteCond %{HTTP_HOST} !^www\. [NC]
       RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘No www to www with HTTPS’ is closed to new replies.

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Artur Bobinski](https://wordpress.org/support/users/kentonwebdesign/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/no-www-to-www-with-https/#post-6890604)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
