Title: Redirect from http to https should be automatic?
Last modified: October 26, 2016

---

# Redirect from http to https should be automatic?

 *  [JohnyBeGood](https://wordpress.org/support/users/johnybegood/)
 * (@johnybegood)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/redirect-from-http-to-https-should-be-automatic/)
 * Hi,
 * I have 2 websites on a dedicated server and redirect works on one but not the
   other.
    When I type mydomain.com in the address bar (using Chrome, Fire and IE)
   it gets redirected to **http:**//www.mydomain.com instead of **https**://www.
   mydomain.com Both websites under WordPress Address and Site Address URL have **
   [https://www](https://www).** If I type **htpps**://mydoamin.com it rediirect
   just fine to **[https://www](https://www)**.mydomain.com I’ve been trying for
   days to understand why this site is doing this but no luck.
 * Any suggestion is welcome!

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

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [9 years, 7 months ago](https://wordpress.org/support/topic/redirect-from-http-to-https-should-be-automatic/#post-8357883)
 * > Redirect from http to https should be automatic?
 * It _should_ be automatic but not all things are perfect.
 * Try this: make a backup of your site’s database and files (backups are your friend).
 * [https://codex.wordpress.org/WordPress_Backups](https://codex.wordpress.org/WordPress_Backups)
 * Then treat your site as if it moved from one URL to the other. In this case it’s`
   http://www.mydomain.com` to `https://www.mydomain.com` (http to https).
 * [https://codex.wordpress.org/Moving_WordPress#Changing_Your_Domain_Name_and_URLs](https://codex.wordpress.org/Moving_WordPress#Changing_Your_Domain_Name_and_URLs)
 * After all of the old references are changed to the new one (with https) then 
   the redirect should just work. If something goes wrong then restore the database
   and you’ll be back to where you were before you tried to make changes.
 * [https://codex.wordpress.org/Restoring_Your_Database_From_Backup](https://codex.wordpress.org/Restoring_Your_Database_From_Backup)
 *  Thread Starter [JohnyBeGood](https://wordpress.org/support/users/johnybegood/)
 * (@johnybegood)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/redirect-from-http-to-https-should-be-automatic/#post-8359729)
 * Thanks for the reply!
 * The site had already under WordPress Address and Site Address URL **[https://www](https://www)**.
   mydomain.com but when I type in the browser
    mydomain.com it does not get redirected
   to **[https://www](https://www).**mydomain.com
 * I even backed up and reinstalled WordPress and started installation process with
   [https://www.mydomain.com](https://www.mydomain.com) and still no luck. Changed
   from https to http and then back to https and still no luck even tried with default
   Twenty Sixteen theme. What is causing to get stuck on **[http://www](http://www).**?
    -  This reply was modified 9 years, 7 months ago by [JohnyBeGood](https://wordpress.org/support/users/johnybegood/).
    -  This reply was modified 9 years, 7 months ago by [JohnyBeGood](https://wordpress.org/support/users/johnybegood/).
    -  This reply was modified 9 years, 7 months ago by [JohnyBeGood](https://wordpress.org/support/users/johnybegood/).
 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/redirect-from-http-to-https-should-be-automatic/#post-8360441)
 * There are two additional things I do to get HTTPS to work on a WordPress site
   when Jan’s recommendation doesn’t work:
    1. In your wp-config.php, add the following code:
    2.     ```
           define('FORCE_SSL_ADMIN', true);
           ```
       
    3. Add the following at the beginning of the .htaccess file in your root WordPress
       folder:
    4.     ```
           RewriteEngine On
           RewriteCond %{HTTPS} !=on
           RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
           ```
       
 * Ordinarily, setting those in addition to the HTTPS in site URL and Address in
   General Settings do the trick.
 *  Thread Starter [JohnyBeGood](https://wordpress.org/support/users/johnybegood/)
 * (@johnybegood)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/redirect-from-http-to-https-should-be-automatic/#post-8360890)
 * Thanks!
 * I did as suggested above and now when I go to here [https://www.linksspy.com/seo-tools/free-seo-ssl-scan/](https://www.linksspy.com/seo-tools/free-seo-ssl-scan/)
   and enter mydomain.com under “Your domain”
    I get this:
 * [http://mydomain.com](http://mydomain.com)
    There are the following errors for
   this URI: # description
 * 1 [http://mydomain.com/](http://mydomain.com/) redirects to [https://www.mydomain.com/](https://www.mydomain.com/)
   through a redirect chain. This hurts your rankings
    [http://mydomain.com/](http://mydomain.com/)–
   > [https://mydomain.com/](https://mydomain.com/) –> [https://www.mydomain.com/](https://www.mydomain.com/)
 * which means its bad for SEO.
 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/redirect-from-http-to-https-should-be-automatic/#post-8360905)
 * I wouldn’t use the “www” subdomain in your site address or URL. It’s kind of 
   a holdover from the old days when the web was new. Now it’s assumed that if you’re
   going to a domain, it’s a web site. Just use “[https://yourdomain.com&#8221](https://yourdomain.com&#8221);
   for both the site and home settings as long as your SSL certificate supports 
   it. Most SSL certs these days do. Test it again after making that change and 
   you should be okay.
 * I just checked one of my SSL sites on linksspy.com, and it had no errors, so 
   I think you can get there with the settings I suggested.
 * By the way, you’re going to need to make sure that all the links in your content,
   widgets, etc. as well as the src for images are set to HTTPS, or are protocol-
   neutral, too.
    -  This reply was modified 9 years, 7 months ago by [linux4me2](https://wordpress.org/support/users/linux4me2/).
 *  Thread Starter [JohnyBeGood](https://wordpress.org/support/users/johnybegood/)
 * (@johnybegood)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/redirect-from-http-to-https-should-be-automatic/#post-8364534)
 * I got it to work! Thank you so much!
 * Since google.com gets still forwarded to [https://www.google.com](https://www.google.com)
   I’m following them for now 🙂
 * I did turn off auto redirect to www and in WordPress settings I already had [https://www.mydomain.com](https://www.mydomain.com)
 * With your .htaccess suggestion I changed from:
    `RewriteRule ^ https://%{HTTP_HOST}%{
   REQUEST_URI} [L,R=301]` to `RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI}[
   L,R=301]` now it gets redirected from mydomain.com to [https://www.mydomain.com](https://www.mydomain.com)
   And the best part is linksspy.com is not finding any errors!
 * All of my images are https and every link I visit I get green pad lock.
 * It still blows my mind why other domain I did not had to do any of this. It just
   works out of box.
    Oh well, I’ve been trying to get this to work for days now
   and I’m glad its working.
 * Thanks again!
    -  This reply was modified 9 years, 7 months ago by [JohnyBeGood](https://wordpress.org/support/users/johnybegood/).
      Reason: edit

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

The topic ‘Redirect from http to https should be automatic?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [JohnyBeGood](https://wordpress.org/support/users/johnybegood/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/redirect-from-http-to-https-should-be-automatic/#post-8364534)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
