Title: Force wp to add https://www. with .htaccess
Last modified: January 22, 2020

---

# Force wp to add https://www. with .htaccess

 *  Resolved [2and8](https://wordpress.org/support/users/2and8/)
 * (@2and8)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/force-wp-to-add-https-www-with-htaccess/)
 * I have the latest version of wp in my root directory. I want to make it so the
   domain is always forced to display [https://www](https://www). So even if someone
   just enters [https://domain.com](https://domain.com) it will then force the www.
   too.
 * In my wp-admin general settings both WordPress Address (URL) and Site Address(
   URL) is set as [https://domain.com](https://domain.com)
 * I’ve tried various .htaccess modifications from searching google but they always
   create redirect errors.
 * Thanks for your time.
    -  This topic was modified 6 years, 3 months ago by [2and8](https://wordpress.org/support/users/2and8/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 3 months ago](https://wordpress.org/support/topic/force-wp-to-add-https-www-with-htaccess/#post-12353494)
 * First, you need to change the setting in settings->general to `https://www.example.
   com`.
 * Then, edit your .htaccess file and add this at the top
 *     ```
       #Force https
       RewriteEngine On
       RewriteCond %{SERVER_PORT} 80 
       RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L,NE] 
       #Force www
       RewriteEngine on
       RewriteCond %{HTTP_HOST} ^example.com [NC]
       RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301,NC]
       ```
   
 *  [Little Package](https://wordpress.org/support/users/littlepackage/)
 * (@littlepackage)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/force-wp-to-add-https-www-with-htaccess/#post-12353500)
 * Hi [@2and8](https://wordpress.org/support/users/2and8/)
 * How about setting your WP address and Site URL to [https://www.domain.com](https://www.domain.com)
   and then using a plugin like Really Simple SSL to force the SSL? You might also
   then set up a redirect at your host level.
 *  Thread Starter [2and8](https://wordpress.org/support/users/2and8/)
 * (@2and8)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/force-wp-to-add-https-www-with-htaccess/#post-12353547)
 * Well, you made that easy Steve. Thank you very, very much to both of you for 
   the quick replies. Excellent support.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Force wp to add https://www. with .htaccess’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [2and8](https://wordpress.org/support/users/2and8/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/force-wp-to-add-https-www-with-htaccess/#post-12353547)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
