Title: OK: HTTP to HTTPS: once and for all&#8230;&#8230;
Last modified: May 9, 2017

---

# OK: HTTP to HTTPS: once and for all……

 *  [gweb1](https://wordpress.org/support/users/gweb1/)
 * (@gweb1)
 * [9 years ago](https://wordpress.org/support/topic/ok-http-to-https-once-and-for-all/)
 * This is becoming very frustrating as there are literally a hundred different 
   answers to this issue. I need to know what to write in my HTACCESS file to sort
   this out. Please; if anyone can help me!
 * I need the following (first line is what someone types in – and the second URL
   is what I need the resulting URL to be.
 * website.com >>> **[https://www](https://www).**website.com
 * **http://**website.com >>> **[https://www](https://www).**website.com
 * **www.**website.com >>> **[https://www](https://www).**website.com
 * **[http://www](http://www).**website.com >>> **[https://www](https://www).**website.
   com
 * website.com**/about/** >>> **https://**[http://www.website.com](http://www.website.com)**/
   about/**
 * **http://**website.com**/about/** >>> **[https://www](https://www).**website.
   com**/about/ **
 * **www.**website.com**/about/** >>> **[https://www](https://www).**website.com**/
   about/ **
 * **[http://www](http://www).**website.com**/about** >>> **[https://www](https://www).**
   website.com**/about/ **
 * ***** in simple terms: I need every incarnation of a URL to result in the correct(
   https) URL and also; every incarnation of a URL with a page extension – to result
   in the correct (https) URL for that page.
 * At the moment; it is all over the place; and I am reading so many different things.
   please please help.

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

 *  [HudsonValleyWebDesign](https://wordpress.org/support/users/jaycbrf/)
 * (@jaycbrf)
 * [9 years ago](https://wordpress.org/support/topic/ok-http-to-https-once-and-for-all/#post-9114145)
 * [http://www.inmotionhosting.com/support/website/ssl/how-to-force-https-using-the-htaccess-file](http://www.inmotionhosting.com/support/website/ssl/how-to-force-https-using-the-htaccess-file)
 * [http://www.wpbeginner.com/wp-tutorials/how-to-add-ssl-and-https-in-wordpress/](http://www.wpbeginner.com/wp-tutorials/how-to-add-ssl-and-https-in-wordpress/)
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [9 years ago](https://wordpress.org/support/topic/ok-http-to-https-once-and-for-all/#post-9114148)
 * Use the plugin “better search and replace”. Search for `http://website.com` and
   replace with `https://website.com`
 *  [Liam Stewart](https://wordpress.org/support/users/gingeds/)
 * (@gingeds)
 * [9 years ago](https://wordpress.org/support/topic/ok-http-to-https-once-and-for-all/#post-9118301)
 * Having www and non-www running with no redirect causes Google to believe the 
   site is two different ones (duplicate content) – which hurts your Google ranking.
 * You can make it https:// by adding the following to your **.htaccess**
 *     ```
       RewriteEngine on
   
       RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
       RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
   
       RewriteCond %{HTTPS} !on
       RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
       ```
   
 * This will redirect
 *  [http://example.com](http://example.com)
    [http://www.example.com](http://www.example.com)
   [https://www.example.com](https://www.example.com)
 * to
 *  [https://example.com](https://example.com)
 * You can make it [https://www](https://www). by adding the following to your **.
   htaccess**
 *     ```
       RewriteEngine on
       RewriteCond %{HTTPS} !on [OR]
       RewriteCond %{HTTP_HOST} !^www\.
       RewriteRule (.*) https://www.example.com%{REQUEST_URI} [L,R=301]
       ```
   
 * This will redirect
 *  [http://example.com](http://example.com)
    [http://www.example.com](http://www.example.com)
   [https://example.com](https://example.com)
 * to
 *  [https://www.example.com](https://www.example.com)
 *  Thread Starter [gweb1](https://wordpress.org/support/users/gweb1/)
 * (@gweb1)
 * [9 years ago](https://wordpress.org/support/topic/ok-http-to-https-once-and-for-all/#post-9122455)
 * ^ Liam! That may have done it (I think so!)
 * I added:
 *     ```
       RewriteEngine on
       RewriteCond %{HTTPS} !on [OR]
       RewriteCond %{HTTP_HOST} !^www\.
       RewriteRule (.*) https://www.example.com%{REQUEST_URI} [L,R=301]
       ```
   
 * ABOVE the WordPress ‘stuff’ in the HTACCESS file… is that right???
 *  [Liam Stewart](https://wordpress.org/support/users/gingeds/)
 * (@gingeds)
 * [9 years ago](https://wordpress.org/support/topic/ok-http-to-https-once-and-for-all/#post-9122468)
 * Yes! 🙂
 *  Thread Starter [gweb1](https://wordpress.org/support/users/gweb1/)
 * (@gweb1)
 * [9 years ago](https://wordpress.org/support/topic/ok-http-to-https-once-and-for-all/#post-9122491)
 * Liam, let me send you a virtual hug!!!! There is about a thousand different opinions
   and code differences as far as I can see, online and so I hope this did it!!!!!
   Seems to work 🙂
 *  [Liam Stewart](https://wordpress.org/support/users/gingeds/)
 * (@gingeds)
 * [9 years ago](https://wordpress.org/support/topic/ok-http-to-https-once-and-for-all/#post-9122504)
 * Glad it is working for you! 🙂

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

The topic ‘OK: HTTP to HTTPS: once and for all……’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 4 participants
 * Last reply from: [Liam Stewart](https://wordpress.org/support/users/gingeds/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/ok-http-to-https-once-and-for-all/#post-9122504)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
