Title: HTTP to HTTPS
Last modified: August 22, 2016

---

# HTTP to HTTPS

 *  [animagic](https://wordpress.org/support/users/animagic/)
 * (@animagic)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/http-to-https-1/)
 * Having a couple issues when attempting to redirect from HTTP to HTTPS. The site
   is a subdomain that I use for testing purposes. i’ll call it my.example.com for
   this post.
 * 1) After going into the admin page and changing the WordPress Address URL and
   Site Address URL to [https://my.example.com](https://my.example.com), the settings
   get saved, the session times out and forces me to close/reopen the browser to
   see the website. This is fine except that I lose the ability to reach my admin
   login. Any attempts to locate the URL time out and/or redirect me to the site
   address.
 * 2) I am also having an issue with the 301 redirect code in htaccess. I am using
   the following but I can’t seem to place it correctly within htaccess so that 
   it works:
 * RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example.com [NC,OR] RewriteCond %{
   HTTP_HOST} ^www.example.com [NC] RewriteRule ^(.*)$ [https://www.my.example.com/$1](https://www.my.example.com/$1)[
   L,R=301,NC]
 *  I have the standard code that comes after #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>
 * as well as the firewall rules, etc added from All-In-One WP Security. It could
   possibly be a plugin conflict but its also likely I am not placing the 301 redirect
   correctly.
 * 3) I am also having a problem with the CSS in my theme breaking after changing
   the URLs to [https://](https://wordpress.org/support/topic/http-to-https-1/?output_format=md).
   In IE, the site looks semi-normal but my font.css is not reflected and a few 
   items in my main css file. In Chrome/Firefox the site has no CSS at all and shows
   just the index of the pages. The CSS files are called with the get_template_directory
   function in my header.php file.
 * Any help would be appreciated,
 * Thanks

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

 *  Thread Starter [animagic](https://wordpress.org/support/users/animagic/)
 * (@animagic)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/http-to-https-1/#post-5542438)
 * Update, I have fixed the issue with my CSS. Needed to place a parse_url( ,PHP_URL_PATH)
   around get_template_directory.
 * I still have an issue with wp-login.php being unaccessible though.
 *  Thread Starter [animagic](https://wordpress.org/support/users/animagic/)
 * (@animagic)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/http-to-https-1/#post-5542550)
 * Just an update for anyone having HTTPS issues. I found that my issue was the 
   Load Balancer that my server pair is behind. My host had not configured it properly
   to send the X-Forward-Proto header that a proxy requires. The LB is doing the
   SSL handling so it requires the header.
 * wp-config.php requires the following which is noted in the wiki page [http://codex.wordpress.org/Administration_Over_SSL](http://codex.wordpress.org/Administration_Over_SSL)
 *  define(‘FORCE_SSL_ADMIN’, true);
    if ($_SERVER[‘HTTP_X_FORWARDED_PROTO’\ == ‘
   https’) $_SERVER[‘HTTPS’]=’on’;
 * What is not noted is a working 301 Redirect for proxy to make the entire site
   [https://](https://wordpress.org/support/topic/http-to-https-1/?output_format=md).
   I used the following:
 *  RewriteCond %{HTTP_HOST} ^my.example.com$ [NC]
    RewriteCond %{HTTP:X-Forwarded-
   Proto} !https RewriteCond %{HTTPS} off RewriteRule ^ [https://%](https://%){HTTP_HOST}%{
   REQUEST_URI} [R=301,L]

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

The topic ‘HTTP to HTTPS’ is closed to new replies.

## Tags

 * [broken CSS](https://wordpress.org/support/topic-tag/broken-css/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [load balancer](https://wordpress.org/support/topic-tag/load-balancer/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [reverse proxy](https://wordpress.org/support/topic-tag/reverse-proxy/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 1 participant
 * Last reply from: [animagic](https://wordpress.org/support/users/animagic/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/http-to-https-1/#post-5542550)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
